Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: test for departure from linearity


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: test for departure from linearity
Date   Fri, 18 Nov 2005 13:54:12 +0100

Raoul:

A large sample size could explain why you find significant results, but do not see them in a graphical representation. Some people prefer comparing BICs in large datasets for that reason (e.g. Raftery 1995). 

Another way to get a feel about the deviation between those two models is:

xi: regress BP i.age
sort age
predict yhat
twoway lfit BP age || line yhat age

Hope this helps,
Maarten

Adrian E. Raftery (1995) Bayesian model selection in social research, Sociological Methodology, vol. 25, pp. 111-163.

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Raoul C Reulen
Sent: vrijdag 18 november 2005 12:15
To: [email protected]
Subject: st: test for departure from linearity

Dear Statalisters,

What is the best way to test for a departure from linearity in a regression model? Graphically or statistically? I ask this because when I use, for example graphical methods like: .lincheck or .cprplot (component plus residual plot), or .acprplot(augmented component plus residual) the variable that I test (age) looks very linear. However, when I do a statistical test for it, it is not linear!
I first create a regression model with a dummy variable(i.age) and then compare it to a regression model with the same
variable but then as an ordinal variable (age). See below for an example (BP=blood pressure)

xi: regress BP i.age
estimate store Model1
regress BP age
estimate store Model2
lrtest M2 M2

My sample size is very large (approx 20,000 subjects), could this be why the test gives a significant result while the plots look very linear?

Thanks

Raoul

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index