SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
systemfit 3sls error: index larger than maximal 0 and/or variable lengths differ [ Reply ]
By: Tiffany Jiang on 2020-09-28 10:07
[forum:48191]
(For better formatting, I also have a post on Stackoverflow here: https://stackoverflow.com/questions/64059516/systemfit-3sls-error-error-in-intii-n-xdim1-dn1-give-dn-false) - my apologies if this is unconventional.

I'm attempting to replicate a regression run by Barro and Sala-i-Martin modeling the growth rate of real per capita GDP for three time periods (1965-1975, 1975-1985, 1985-1995). I have staged the data and am trying to run a 3sls regression in R.

The setup is the following: for a set of 100+ countries, I have data on certain variables over the three time periods. Some of these variables are normal regressors and others are instrumental variables - in addition, I have two dummy variables to represent the time periods themselves.

I want to run a 3sls regression where the three equations are the same variables and dependent variable, but in three time periods. The variances of the error terms are allowed to be correlated over the time periods and to have different variances for each period.

The StackOverflow post has an example of what my data looks like, and I will work on coming up with a reproducible version of my data to help better debug. But in the meantime in case anyone can help me understand and debug this error, I get:

Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) :
index larger than maximal 0

After filtering the dataset to just countries with complete data (all variables existing for the regression) and rerunning, I get a new error:

Error in model.frame.default(data = data, na.action = na.pass, formula = ~log.per.capita.gdp.iv.eq1 + :
variable lengths differ (found for 'gov.con.ratio.iv.eq1')

Which I also haven't been able to understand further, since the column cited in the error message is just a column of double values.

Thanks to:
Vienna University of Economics and Business Powered By FusionForge