Problem while running my PLM regression model"length of 'dimnames' [1] not equal to array extent"

HI!

I trying to run a regression model in the following panel data.

#variables

x<-cbind(fpv_dip_)

y<-cbind(maiz_cosecha_, maiz_precio_, soja_cosecha_, soja_precio_, educ_college_2010,population_rural_2001,
population_, educ_mschool_2010,inflacion_)

attach(nuevosdatos)

#between estimator

between<- plm(y~x, data=nuevosdatos, model="fd")

head(data)
id year province department id_d zone labor_occup_2001 population_
1 1 2005 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 12469
2 1 2007 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 12469
3 1 2009 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 12469
4 1 2011 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 16245
5 1 2013 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 16245
6 1 2015 Buenos Aires Adolfo Alsina 529 No Nucleo 5839 16245
population_rural_2001 educ_mschool_2010 educ_college_inc_2010 educ_college_2010 fpv_dip_
1 4645 2100 410 481 0.22
2 4645 2100 410 481 0.50
3 4645 2100 410 481 0.17
4 4645 2100 410 481 0.40
5 4645 2100 410 481 0.28
6 4645 2100 410 481 0.25
fpv_pres_ maiz_cosecha_ soja_cosecha_ soja_precio_ maiz_precio_ inflacion_
1 NA 16000 36354 31.320.001 95 12,3
2 0.41 12500 52500 40.239.999 160 14,8
3 NA 7500 70607 45.289.999 155 11,4
4 0.38 15000 70000 48.720.001 300 19,3
5 NA 13000 82000 49.070.001 195 27,7
6 0.28 12000 82000 39.939.999 170 23,6

This error pops out: > between<- plm(y~x, data=nuevosdatos, model="fd")
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent

How can I solve this issue??

Thanks!

You define the objects x and y, then you attach nuevosdatos, then you run plm() with the call

plm(y~x, data=nuevosdatos, model="fd")

Do you intend the x and y in that call to come from nuevosdatos or to be the objects that you defined? Setting data = nuevosdatos in the plm() call means that y ~ x refers to columns in nuevosdatos.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.