GLS "no terms component" error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GLS "no terms component" error

mm745
Hi,

I want to test for independence in my GLS model fitp2, but when I try to use the
dwtest function in the lmtest library, I get the error message "Error in
terms.default(formula) : no terms component".

The model and data set are below. Any suggestions would be really helpful!
Thanks a lot in advance,

M. Grace


fitp2:
fitp2<-gls(V3_total~D_total+P_total,data=pdata,weights=varPower())

based on the data set pdata:
pdata
  D_total V3_total   P_total
1       75   158000   302.033
2      221   258000   126.664
3     1050   280000   538.547
4     8100   208000  1090.068
5    22100   235000  2038.937
6     5300   570000  2626.226
7     3250   454000  2326.473
8     6540   169000  5613.525
9     5248   247000  6011.532
10   22484   542000 15140.006
11   30841   530000 13324.048
12    7480   497000 10481.812
13    2664   467000  5776.274
14     432   285000  1849.763


------------------------------------------------------------------
University of St Andrews Webmail: https://webmail.st-andrews.ac.uk

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: GLS "no terms component" error

Bill.Venables
The help file for dwtest says

formula: a symbolic description for the model to be tested (or a fitted
"lm" object).  

It is not clear from your message, but it would seem that you used fitp2
as the argument to dwtest.  (In any case, this gives the error message
you quote?)

But fitp2 is neither a formula, nor is it an object ineriting from "lm".

Why did you expect dwtest to work on a gls object?


Bill Venables
CSIRO Laboratories
PO Box 120, Cleveland, 4163
AUSTRALIA
Office Phone (email preferred): +61 7 3826 7251
Fax (if absolutely necessary):  +61 7 3826 7304
Mobile:                         +61 4 8819 4402
Home Phone:                     +61 7 3286 7700
mailto:[hidden email]
http://www.cmis.csiro.au/bill.venables/ 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of [hidden email]
Sent: Sunday, 27 July 2008 6:26 AM
To: [hidden email]
Subject: [R] GLS "no terms component" error

Hi,

I want to test for independence in my GLS model fitp2, but when I try to
use the
dwtest function in the lmtest library, I get the error message "Error in
terms.default(formula) : no terms component".

The model and data set are below. Any suggestions would be really
helpful!
Thanks a lot in advance,

M. Grace


fitp2:
fitp2<-gls(V3_total~D_total+P_total,data=pdata,weights=varPower())

based on the data set pdata:
pdata
  D_total V3_total   P_total
1       75   158000   302.033
2      221   258000   126.664
3     1050   280000   538.547
4     8100   208000  1090.068
5    22100   235000  2038.937
6     5300   570000  2626.226
7     3250   454000  2326.473
8     6540   169000  5613.525
9     5248   247000  6011.532
10   22484   542000 15140.006
11   30841   530000 13324.048
12    7480   497000 10481.812
13    2664   467000  5776.274
14     432   285000  1849.763


------------------------------------------------------------------
University of St Andrews Webmail: https://webmail.st-andrews.ac.uk

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: GLS "no terms component" error

mm745
Thank you, Bill. I think I misread some text in my statistics handbook. This has
helped to clear it up. Sorry for taking up your time and thank you for replying.

M. Grace

Quoting [hidden email]:

> The help file for dwtest says
>
> formula: a symbolic description for the model to be tested (or a fitted
> "lm" object).
>
> It is not clear from your message, but it would seem that you used fitp2
> as the argument to dwtest.  (In any case, this gives the error message
> you quote?)
>
> But fitp2 is neither a formula, nor is it an object ineriting from "lm".
>
> Why did you expect dwtest to work on a gls object?
>
>
> Bill Venables
> CSIRO Laboratories
> PO Box 120, Cleveland, 4163
> AUSTRALIA
> Office Phone (email preferred): +61 7 3826 7251
> Fax (if absolutely necessary):  +61 7 3826 7304
> Mobile:                         +61 4 8819 4402
> Home Phone:                     +61 7 3286 7700
> mailto:[hidden email]
> http://www.cmis.csiro.au/bill.venables/
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of [hidden email]
> Sent: Sunday, 27 July 2008 6:26 AM
> To: [hidden email]
> Subject: [R] GLS "no terms component" error
>
> Hi,
>
> I want to test for independence in my GLS model fitp2, but when I try to
> use the
> dwtest function in the lmtest library, I get the error message "Error in
> terms.default(formula) : no terms component".
>
> The model and data set are below. Any suggestions would be really
> helpful!
> Thanks a lot in advance,
>
> M. Grace
>
>
> fitp2:
> fitp2<-gls(V3_total~D_total+P_total,data=pdata,weights=varPower())
>
> based on the data set pdata:
> pdata
>   D_total V3_total   P_total
> 1       75   158000   302.033
> 2      221   258000   126.664
> 3     1050   280000   538.547
> 4     8100   208000  1090.068
> 5    22100   235000  2038.937
> 6     5300   570000  2626.226
> 7     3250   454000  2326.473
> 8     6540   169000  5613.525
> 9     5248   247000  6011.532
> 10   22484   542000 15140.006
> 11   30841   530000 13324.048
> 12    7480   497000 10481.812
> 13    2664   467000  5776.274
> 14     432   285000  1849.763
>
>
> ------------------------------------------------------------------
> University of St Andrews Webmail: https://webmail.st-andrews.ac.uk
>
> ______________________________________________
> [hidden email] 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.
>
>
>




------------------------------------------------------------------
University of St Andrews Webmail: https://webmail.st-andrews.ac.uk

______________________________________________
[hidden email] 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.