iamisha1 at comcast.net
2007-May-09 21:47 UTC
[R] Errors with systemfit package and systemfitClassic()
I get the following error message after using the sysfit package's function 'systemfitClassic': Error in data[[eqnVar]] : subscript out of bounds When I do this: MSYS1 <- cbind(Y, Num, F, PO, PD, GO, GD) MigOLS1 <- systemfitClassic("OLS", F ~ PO + PD + GO + GD, eqnVar = "Num", timeVar = "Y", data = MSYS1) and I get this error message: Error in inherits(x, "factor") : attempt to select more than one element when I do this (removing quotes from columns set as 'eqnVar' and 'timeVar'): MSYS1 <- cbind(Y, Num, F, PO, PD, GO, GD) MigOLS1 <- systemfitClassic("OLS", F ~ PO + PD + GO + GD, eqnVar = Num, timeVar = Y, data = MSYS1) When I query 'typeof()' I get the following: Y: Integer Num: Integer F: Integer PO: Integer PD: Integer GO: Double GD: Double I have set my data up in a manner analogous to that in the examples in the systemfit documentation. Also, the panel is balanced. If it matters, here are some descriptions of the data: Y: Year Num: ID of Flow F: Flow PO: Origin Population PD: Destination Population GO: Origin GDP GD: Destination GDP [[alternative HTML version deleted]]
Arne Henningsen
2007-Jun-07 06:16 UTC
[R] Errors with systemfit package and systemfitClassic()
Hi iamisha1: Sorry for answering so late! On Wednesday 09 May 2007 23:47, iamisha1 at comcast.net wrote:> I get the following error message after using the sysfit package's function > 'systemfitClassic': > > Error in data[[eqnVar]] : subscript out of bounds > > When I do this: > > MSYS1 <- cbind(Y, Num, F, PO, PD, GO, GD) > MigOLS1 <- systemfitClassic("OLS", F ~ PO + PD + GO + GD, eqnVar = "Num", > timeVar = "Y", data = MSYS1) and I get this error message:Argument "data" must be a "data.frame" (please read the documentation!). Hence, systemfitClassic( [...], data = as.data.frame( MSYS1 ) ) or MSYS1 <- as.data.frame( cbind(Y, Num, F, PO, PD, GO, GD) ) should work. Arne> > Error in inherits(x, "factor") : attempt to select more than one element > > when I do this (removing quotes from columns set as 'eqnVar' and > 'timeVar'): > > MSYS1 <- cbind(Y, Num, F, PO, PD, GO, GD) > MigOLS1 <- systemfitClassic("OLS", F ~ PO + PD + GO + GD, eqnVar = Num, > timeVar = Y, data = MSYS1) > > When I query 'typeof()' I get the following: > > Y: Integer > Num: Integer > F: Integer > PO: Integer > PD: Integer > GO: Double > GD: Double > > I have set my data up in a manner analogous to that in the examples in the > systemfit documentation. Also, the panel is balanced. If it matters, here > are some descriptions of the data: > > Y: Year > Num: ID of Flow > F: Flow > PO: Origin Population > PD: Destination Population > GO: Origin GDP > GD: Destination GDP > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html and provide commented, minimal, > self-contained, reproducible code.-- Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/