楼主: sun1018
29357 67

[问答] 请问有人知道在r中那个包可以做面板数据的半参数时变系数,我需要系数岁时间变化的图 [推广有奖]

11
sun1018 发表于 2012-4-10 13:01:38 来自手机
ywh19860616 发表于 2012-4-10 08:18
这个应该是你数据问题
问题已经解决了,你说的那个package我一直按装不了,我的说版本没有,可是我是最新版本啊

12
ywh19860616 发表于 2012-4-11 18:15:21
sun1018 发表于 2012-4-10 13:01
问题已经解决了,你说的那个package我一直按装不了,我的说版本没有,可是我是最新版本啊
rqpd.rar (172.08 KB)

这个是我电脑上安装好的文件。如果还是不能正常运行,你试下载个R12.2
我在这个版本可以正常使用。
一份耕耘,一份收获。

13
epoh 发表于 2012-4-11 21:27:35
sun1018 发表于 2012-4-9 16:36
这个包我有,的确是做面板的,不过没有我说的模型,这个模型估计要总非参数方法,在非参数方法里倒是有个 ...
希望这篇文献对你有帮助.
NONPARAMETRIC AND SEMIPARAMETRIC METHODS IN R
page 28/36 3.12. Panel Data Models
###########
library(plm)
library(Ecdat)
data(Airline)
library(np)
attach(Airline)
lcost <- as.numeric(log(cost))
loutput <- as.numeric(log(output))
lpf <- as.numeric(log(pf))
lf <- as.numeric(lf)
bw <- npregbw(lcost~loutput + lpf + lf + ordered(year) + factor(airline), regtype="ll", bwmethod="cv.aic", ukertype="liracine", okertype="liracine")
summary(bw)
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
kk22boy + 5 + 5 + 5 热心帮助其他会员

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

14
sun1018 发表于 2012-5-5 20:20:11
ywh19860616 发表于 2012-4-11 18:15
这个是我电脑上安装好的文件。如果还是不能正常运行,你试下载个R12.2
我在这个版本可以正常使用。
...
这个也不能使用啊,里面应该有个NAMESPACE文件的 吧,你给我发的没有,安装后无法使用,您能把您R语言library目录下的程序包给我发一个吗?我下载了三个R的版本都不行,郁闷了,麻烦您在帮我看看,谢谢了 ,不胜感激额

15
ywh19860616 发表于 2012-5-5 22:05:35
sun1018 发表于 2012-5-5 20:20
这个也不能使用啊,里面应该有个NAMESPACE文件的 吧,你给我发的没有,安装后无法使用,您能把您R语言lib ...
噢,那抱歉了,这个我也不知道问题在哪
以前上传的rqpd就是我从安装好的library中解压出来的,在我这里也没有NAMESPACE文件,但是可以正常使用。
和其他包不一样,这个包并未正式发布的,所以是没有NAMESPACE文件。
建议你可以联系下开发包的作者,应该可以解决。
一份耕耘,一份收获。

16
epoh 发表于 2012-5-6 09:04:49
sun1018 发表于 2012-5-5 20:20
这个也不能使用啊,里面应该有个NAMESPACE文件的 吧,你给我发的没有,安装后无法使用,您能把您R语言lib ...
from R 2.14.0 all packages have a namespace
package 'rqpd': Built: R 2.13.0; 2011-05-06 ; windows
所以你要安装 R version 2.13.0
ywh兄提供的版本可以使用
安装顺序
R version 2.13.0
package 'quantreg'
package  rqpd_0.5.zip
package 'MatrixModels'
package 'Formula'
######
library(rqpd)
set.seed(10)
m <- 3
n <- 10
s <- as.factor(rep(1:n,rep(m,n)))
x <- exp(rnorm(n*m))
u <- x*rnorm(m*n) + (1-x)*rf(m*n,3,3)
a <- rep(rnorm(n),rep(m,n))
y <- a + u
fit <- rqpd(y ~ x | s, panel(lambda = 5))
sfit <- summary(fit)

# A CRE model
data(bwd)

cre.form <- dbirwt ~ smoke + dmage + agesq +
   novisit + pretri2 + pretri3 | momid3 | smoke +
   dmage + agesq

# CRE-M type fit:
crem.fit <- rqpd(cre.form, panel(method="cre"), data=bwd)
crem.fit

Call:
rqpd(formula = cre.form, panel = panel(method = "cre"), data = bwd)

Coefficients:
(Intercept)[0.25]       smoke[0.25]       dmage[0.25]       agesq[0.25]
     2440.2336143      -114.2131886        -5.5970239         0.4268880
    novisit[0.25]     pretri2[0.25]     pretri3[0.25]     m.smoke[0.25]
     -380.3047734       -39.3595390        -5.3371753      -167.8668046
    m.dmage[0.25]     m.agesq[0.25]  (Intercept)[0.5]        smoke[0.5]
       55.1567177        -1.1890590      2943.0862058      -118.9682812
       dmage[0.5]        agesq[0.5]      novisit[0.5]      pretri2[0.5]
      -37.6414221         0.9771566      -177.3260213       -23.9477189
     pretri3[0.5]      m.smoke[0.5]      m.dmage[0.5]      m.agesq[0.5]
      -18.4187786      -144.4995484        71.7491954        -1.4448411
(Intercept)[0.75]       smoke[0.75]       dmage[0.75]       agesq[0.75]
     3367.5109878      -120.6370785       -29.1507203         0.8348498
    novisit[0.75]     pretri2[0.75]     pretri3[0.75]     m.smoke[0.75]
      -21.2166704        23.6103748       -39.4958273      -138.3875937
    m.dmage[0.75]     m.agesq[0.75]
       54.8864519        -1.1462282

Degrees of freedom: 13154 total; 13124 residual
已有 3 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
DDDang12 + 5 + 2 + 2 + 2 精彩帖子
kk22boy + 5 + 5 + 5 谢谢epoh兄~
ywh19860616 + 5 + 5 + 5 谢谢epoh老师

总评分: 论坛币 + 5  学术水平 + 12  热心指数 + 12  信用等级 + 12   查看全部评分

17
ywh19860616 发表于 2012-5-6 09:11:24
epoh 发表于 2012-5-6 09:04
from R 2.14.0 all packages have a namespace
package 'rqpd': Built: R 2.13.0; 2011-05-06 ; windows ...
epoh老师,您好,我还有一个疑问。
这个rqpd包应该是未正式发布的,还在developing,按照作者给出的安装方式:
install.packages("rqpd", repos="http://R-Forge.R-project.org")

我利用这个命令安装成功过,但是现在在R2.14.2安装会出现错误:
警告: 无法在貯藏處http://R-Forge.R-project.org/bin/windows/contrib/2.14中读写索引
警告信息:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘rqpd’ is not available (for R version 2.14.2

似乎这种错误也很常见,您知道原因吗?
一份耕耘,一份收获。

18
epoh 发表于 2012-5-6 09:29:46
ywh19860616 发表于 2012-5-6 09:11
epoh老师,您好,我还有一个疑问。
这个rqpd包应该是未正式发布的,还在developing,按照作者给出的安装 ...
R version 2.13.0
也发生一样错误
Warning: unable to access index for repository http://R-Forge.R-project.org/bin/windows/contrib/2.13
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘rqpd’ is not available (for R version 2.13.0)

我觉得跟project administrators有关
以rqpd为例
Request to join project rqpd
You can request to join a project by clicking the submit button.
The administrators will be emailed to approve or deny your request.
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 谢谢epoh老师

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

19
ywh19860616 发表于 2012-5-6 09:31:53
epoh 发表于 2012-5-6 09:29
R version 2.13.0
也发生一样错误
Warning: unable to access index for repository http://R-Forge.R- ...
谢谢epoh老师,那还是最好下载到本地安装。
一份耕耘,一份收获。

20
epoh 发表于 2012-5-6 09:42:59
ywh19860616 发表于 2012-5-6 09:11
epoh老师,您好,我还有一个疑问。
这个rqpd包应该是未正式发布的,还在developing,按照作者给出的安装 ...
rqpd : Regression Quantiles for Panel Data
          Build status: Failed to build
Build status codes


0 - Current: the package is available for download. The corresponding package
     passed checks on the Linux and Windows platform without ERRORs.
1 - Scheduled for build: the package has been recognized by the build system
     and provided in the staging area.
2 - Building: the package has been sent to the build machines. It will be built
     and checked using the latest patched version of R. Note that it is included
     in a batch of several packages. Thus, this process will take some time to finish.
3 - Failed to build: the package failed to build or did not pass the checks on the
     Linux and/or Windows platform. It is not made available since it does not meet the policies.
4 - Conflicts: two or more packages of the same name exist. None of them will be built.
     Maintainers are asked to negotiate further actions.
5 - Offline: the package is not available. The build system may be offline or
    the package maintainer did not trigger a rebuild (done e.g., via committing to the package repository).
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 谢谢

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-25 08:04