# Re: [R] Question about linear models

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Tue, 18 Nov 2008 23:55:30 -0500

http://www.ugr.es/~falvarez/relaMetodos2.pdf ..... see Question 9 http://www.uclm.es/profesorado/jesuslopezfidalgo/MODELOS.pdf ...... see Question 47

```--
David Winsemius, MD
Heritage Labs

On Nov 18, 2008, at 11:44 PM, Ricardo Ríos wrote:

> Hi wizards,

>
> I have the following model:
>
> x<-c(20.79, 22.40, 23.15, 23.89, 24.02, 25.14, 28.49, 29.04, 29.88,
> 30.06)
> y <- c(194.5, 197.9, 199.4, 200.9, 201.4, 203.6, 209.5, 210.7,
> 211.9, 212.2)
> model1 <- lm( y ~ x )
> anova(model1)
>
>         Df Sum Sq Mean Sq F value    Pr(>F)
> x          1 368.87  368.87  4384.6 3.011e-12 ***
> Residuals  8   0.67    0.08
>
>
> But, I have realized the following transformation:
>
> lnx <- log(x)
> lny <- log(y)
> model2 <- lm( lny ~ lnx )
> anova(model2)
>
> Response: lny
>         Df    Sum Sq   Mean Sq F value    Pr(>F)
> lnx        1 0.0088620 0.0088620   27234 2.034e-15 ***
> Residuals  8 0.0000026 0.0000003
>
>
>
> The second model has a Sum of square Residuals very small
>
> I have analyzed the following graph:
>
> plot( model1\$fitted.values, model1\$residuals)
> plot( model2\$fitted.values, model2\$residuals)
>
>
> I have observed that maybe the first model has a specification error.
> is that correct? Which model is the best?
>
> anything.
>
>
>
> --
> http://ricardorios.wordpress.com/
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help