[R] Statistical analysis

cls59 chuck at sharpsteen.net
Thu Sep 24 02:07:20 CEST 2009




Chris Li wrote:
> 
> Hi all,
> 
> I have got two datasets, one of them is rainfall data and the other one is
> groundwater level data.
> 
> I would like to see whether there is a correlation between these two
> datasets and if there is, to what extent they are correlated.
> 
> My stats background is limited, therefore any advice on which command I
> should use in R would be greatly appreciated.
> 
> Thanks in advance.
> Chris
> 


Supposing you have two variables-- precipitation, p, and groundwater
potential, h-- a simple test for linear correlation is to produce a
scatterplot of h vs. p:

plot( h ~ p )

If it looks linear, than it may be worthwhile to have R estimate the
coefficient of correlation for the data:

cor( p, h )

If the correlation coefficient is close to +/- 1, than your data is
exhibiting a strong linear trend and a linear model may be appropriate:

linModel <- lm( h ~ p )

abline( linModel )


Good luck!

-Charlie


-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: http://www.nabble.com/Statistical-analysis-tp25531331p25531335.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list