[R] Errors with systemfit package and systemfitClassic()

Arne Henningsen ahenningsen at email.uni-kiel.de
Thu Jun 7 08:16:10 CEST 2007


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/



More information about the R-help mailing list