Replication of the Paper: Leading toward equality: the effect of women mayors on gender equality in local bureaucracies by Kendall D. Funk, Thiago Silva & Maria C. Escobar-Lemmon
0
stars
0
forks
source link
Error:new columns would leave holes after existing columns #1
I am trying to do a simulation (without shocks) with dynsim.
For that I created the linear regression model:
M1 <- lm(pctfempubadmin ~ lag_pctfempubadmin + femalemayor_new + pctfemcouncils_new + left_new + right_new + mayoreducation_new + logpop + loggdppercap + patronage + bureaucracysizepop + mayorage_new + previousterm + yearinterm, table)
Then I created the scenario:
Scen1 <- data.frame(lag_pctfempubadmin = mean(lag_pctfempubadmin2012$lag_pctfempubadmin, na.rm=TRUE), femalemayor_new = 0, pctfemcouncils_new = mean(pctfemcouncils_new, na.rm=TRUE), left_new = 1, right_new = 0, mayoreducation_new = mean(mayoreducation_new, na.rm=TRUE), logpop = mean (logpop, na.rm=TRUE), loggdppercap = mean(loggdppercap, na.rm=TRUE), patronage = mean(patronage, na.rm=TRUE), bureaucracysizepop = mean(bureaucracysizepop, na.rm=TRUE), mayorage_new = mean (mayorage_new, na.rm=TRUE), previousterm = 0, yearinterm = mean(yearinterm, na.rm=TRUE))
But when I wanted to do the simulation it woudn't work becaue of the following error message:
Fehler in[<-.data.frame(tmp, , ldv, value = 62.7697272411698) : new columns would leave holes after existing columns
The code for the Simulation is:
Sim1.1 <- dynsim(M1, lag_pctfempubadmin2012, Scen1, n=11)
where M1 specifies the object, lag_pctfempubadmin the lagged dependent variable and Scen1 is the Scenario.
I didn't find any solution to this problem and have no clue what I have to change...
@FlaviaStalder : if you cannot provide a reproducible example I think we can set up a meeting. @Bazzarillo , any clue about this dynamic simulation function?
I am trying to do a simulation (without shocks) with dynsim. For that I created the linear regression model:
M1 <- lm(pctfempubadmin ~ lag_pctfempubadmin + femalemayor_new + pctfemcouncils_new + left_new + right_new + mayoreducation_new + logpop + loggdppercap + patronage + bureaucracysizepop + mayorage_new + previousterm + yearinterm, table)
Then I created the scenario:Scen1 <- data.frame(lag_pctfempubadmin = mean(lag_pctfempubadmin2012$lag_pctfempubadmin, na.rm=TRUE), femalemayor_new = 0, pctfemcouncils_new = mean(pctfemcouncils_new, na.rm=TRUE), left_new = 1, right_new = 0, mayoreducation_new = mean(mayoreducation_new, na.rm=TRUE), logpop = mean (logpop, na.rm=TRUE), loggdppercap = mean(loggdppercap, na.rm=TRUE), patronage = mean(patronage, na.rm=TRUE), bureaucracysizepop = mean(bureaucracysizepop, na.rm=TRUE), mayorage_new = mean (mayorage_new, na.rm=TRUE), previousterm = 0, yearinterm = mean(yearinterm, na.rm=TRUE))
But when I wanted to do the simulation it woudn't work becaue of the following error message:
Fehler in
[<-.data.frame(
tmp, , ldv, value = 62.7697272411698) : new columns would leave holes after existing columns
The code for the Simulation is:
Sim1.1 <- dynsim(M1, lag_pctfempubadmin2012, Scen1, n=11)
where M1 specifies the object, lag_pctfempubadmin the lagged dependent variable and Scen1 is the Scenario.I didn't find any solution to this problem and have no clue what I have to change...