[R] Using termplot() with transformations of x

Peter Dunn pdunn2 at usc.edu.au
Mon Aug 30 00:48:57 CEST 2010


Hi

>    the two models  are identical because of having the same independent
> variable and dependent variable.they produce different termplot()s because
> of they base on different variables,one is x,the other is logx.see the
> lateral axis.

Sure; this is all obvious from the code and the plots.

But my question is *why* two fundamentally identical models produce different termplot()s?

As the original post asks:  If this is intended, what is the logic? Or am I missing something?

Let me place explain further.

Suppose I try this

m1 <- lm(y~x)
termplot(m1)

and I see that there is a problem.  So I decide to use log(x) as a predictor instead of x; I could do this one of two ways:

logx <- log(x)

m2 <- lm(y~logx)
termplot(m2)

m3 <- lm(y~log(x))
termplot(x3)


In the first case, the new termplot() tells me the model looks good.

In the second case, I output is the same as for termplot(m1) produced, and I don't really learn anything new.  

So the original questions remain: If this is intended, what is the logic? Or am I missing something?

Perhaps I could add: How do I explain and justify this behaviour to someone?

Thanks.

P.



Peter Dunn: Biostatistician (Room T4.12)
School of Health and Sport Science
Faculty of Science, Health and Education  ML-34
University of the Sunshine Coast, Locked Bag 4
Maroochydore DC Qld 4558
 
Tel: +61 7 5456 5085
Fax: +61 7 5430 2896
Email: pdunn2 at usc.edu.au
www.usc.edu.au

CRICOS Provider Number: 01595D
This communication is intended for the recipient only and should not be forwarded, distributed or otherwise read by others without express permission. The views expressed in this email are not necessarily those of the University of the Sunshine Coast.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the R-help mailing list