On 3 September 2010 12:03, zbynek.jano...@gmail.com
<zbynek.jano...@centrum.cz> wrote:
>
> I am having problem using output of lm() function for further analysing using
> systemfit package.
>
> Basicaly, the problem s following - I generate several formulas using lm()
>> fo1 <- lm(r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43])
>> fo2 <- lm(r98[,1] ~ f98[,1] + f98[,2] + ... + f98[,43])
>
> and than I want to estimate a general model using package systemfit.
>
>> fitsur <- systemfit("SUR",list(as.formula(fo),as.formula(foo)))
>
> and I get following error:
> Error in systemfit("SUR", list(as.formula(fo), as.formula(foo))) :
>  argument 'formula' must be an object of class 'formula' or a list of
> objects of class 'formula'
>
> and I am not able to find where the problem is.
> The problem remains even when I try:
>> fo1 <- r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43]
>> fo2 <- r98[,1] ~ f98[,1] + f98[,2] + ... + f98[,43]
> instead of using lm()
> Could someone give me a hand? I am quite new to R, so possibly the solutions
> is simple:)

Yes, the formula(s) must be the *first* argument of the systemfit()
command, e.g.:

R> fitsur <- systemfit( list(as.formula(fo),as.formula(foo)), method = "SUR" )

/Arne

-- 
Arne Henningsen
http://www.arne-henningsen.name

______________________________________________
R-help@r-project.org 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.

Reply via email to