我现在做面板分位数模型,遇到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<-datashz
x<−as.matrix(x)y<−dataugini
y<-as.matrix(y)
fit<- rq.fit.panel(X,y,s)
数据格式是
name year ug shz pgdp ed ope urat 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
。。。
结果总显示错误
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


雷达卡





京公网安备 11010802022788号







