Re: [R] predict lm doubt

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Fri, 18 Mar 2011 09:53:51 -0300

Your lm args are wrong:

Try this:

predict(lm(Dens_min ~ Velocity, dfTestes3sitesCriptic))

or

predict(lm(Dens_min ~ Velocity_corrected, dfTestes3sitesCriptic))

On Fri, Mar 18, 2011 at 9:45 AM, barbara costa <rbarbarahc_at_gmail.com> wrote:
> Hello,
>  does anyone knows this predict is not resulting?
>
> # lm predict
> dfTestes3sitesCriptic$Velocity_corrected <- ifelse
> (dfTestes3sitesCriptic$Season == "A" & dfTestes3sitesCriptic$BeforeAfter ==
> "Before", (dfTestes3sitesCriptic$Velocity * mVel3ABefAfter), (ifelse
> (dfTestes3sitesCriptic$Season == "Sp" & dfTestes3sitesCriptic$BeforeAfter ==
> "Before", (dfTestes3sitesCriptic$Velocity  * mVel3SpBefAfter),
> dfTestes3sitesCriptic$Velocity )))
>
> dfTestes3sitesCriptic$Dens_min_corrected <- predict (lm(
> dfTestes3sitesCriptic$Dens_min ~ dfTestes3sitesCriptic$Velocity,
> dfTestes3sitesCriptic$Velocity_corrected))
>
>
> just for help:
> Code_Site Year Season YearSeason Type_Environment BeforeAfter Species_Group
> 31    PPBNoc 1998      A     1998-A    Criptobenthic      Before
> Fish
> 33    PPBNoc 1999     Sp    1999-Sp    Criptobenthic      Before
> Fish
> 35    PPBNoc 2009      A     2009-A    Criptobenthic       After
> Fish
> 37    PPBNoc 2009     Sp    2009-Sp    Criptobenthic       After
> Fish
> 39    PPBNoc 2010      A     2010-A    Criptobenthic       After
> Fish
>   TransectTime_min TransectLenght_m Area_m2 Number Density Velocity
> Dens_min
> 31            15.00               55      55     89    1.62     3.67
> 5.93
> 33            15.00               55      55     50    0.91     3.67
> 3.33
> 35            18.15               45      45    185    4.11     2.48
> 10.20
> 37            10.23               45      45     92    2.04     4.40
> 9.00
> 39            16.92               45      45    251    5.58     2.66
> 14.84
>   Code_Site2 Velocity_corrected
> 31       TRUE               2.58
> 33       TRUE               3.25
> 35       TRUE               2.48
> 37       TRUE               4.40
> 39       TRUE               2.66
>
>
>
> Thanks a lot.
> Barbara
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_r-project.org 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.
Received on Fri 18 Mar 2011 - 12:57:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Mar 2011 - 13:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive