Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: Testparm Command in Logistic Regression Analysis
From
<[email protected]>
To
<[email protected]>
Subject
RE: st: Testparm Command in Logistic Regression Analysis
Date
Wed, 27 Nov 2013 12:54:43 +0000
Thanks Marteen, this seems to work!
Just in general, is it correct to use the test/testparm command in logistic regression or does it only apply for linear regression models?
As I already stated I can't use the lrtest command to compare nested models because I have different numbers of observations within the models. So what's the appropriate way to test the overall significance of a variable in a logistic regression model (and then to decide whether it stays in the model or not)?
Thank you for your help!
Isabel
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten Buis
Sent: Mittwoch, 27. November 2013 13:40
To: [email protected]
Subject: Re: st: Testparm Command in Logistic Regression Analysis
On Wed, Nov 27, 2013 at 11:16 AM, <[email protected]> wrote:
> I'm performing a logistic regression with 5 categorical predictor variables.
>
> xi: logit status2 i.season2 i.sex2 i.age2 i.unit2 i.distance5
>
> I intended use the- testparm- command for each variable to get an overall significance for the variables in the model.
>
> testparm i.season2
> testparm i.sex2
>
> Both of these commands are not working, as Stata tells me "no such variables".
You should not use the -xi:- prefix anymore. It is only there for some
(user-written) programs that do support the factor variable notation (yet), and for backward compatability for older .do-files. All you need to do to fix your code is leave out the -xi:- prefix.
logit status2 i.season2 i.sex2 i.age2 i.unit2 i.distance5 testparm i.season2 testparm i.sex2
Hope this helps,
Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/