|
请问你的问题解决了吗?我现在做面板分位数模型,也遇到m,n,的设置问题,可能导入的数据格式有问题,或者m,n的设置有问题。我有17年4个个体,因变量有7个,请问该怎么设置m,n,数据导入的格式是怎样的?我的代码是
m<-17
n<-8
s<-rep(1:n,rep(m,n))
data<-read.table('E:/data.txt',header=T)
x<-data$shz
x<-as.matrix(x)
y<-data$ugini
y<-as.matrix(y)
fit<- rq.fit.panel(X,y,s)
数据格式是
name year u_gini shz pgdp edu open urate fd ir
1 hb 1996 0.2278 14.8343 0.4311 6.9428 0.0609 0.3374 1.8193 0.2870
2 hb 1997 0.2446 51.1836 0.4884 7.2215 0.0931 0.3124 1.8064 0.2690
3 hb 1998 0.2446 57.9077 0.5287 7.2980 0.0753 0.3190 2.0237 0.2500
4 hb 1999 0.2625 47.0803 0.5452 7.2904 0.0687 0.3352 2.0624 0.2030
5 hb 2000 0.2427 36.3742 0.6293 7.3480 0.0750 0.4047 1.9931 0.1870
6 hb 2001 0.2501 59.0241 0.6867 7.7651 0.0763 0.4080 2.0682 0.1780
。。。
结果总显示错误
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
> fit<- rq.fit.panel(X,y,s)
Error in rq.fit.panel(X, y, s) : dimensions of y,X,s must match
|