[R] Newbie question: Linear regression with error bars.

Alan Aspuru-Guzik aspuru at okra.cchem.berkeley.edu
Tue Aug 29 02:44:29 CEST 2000


Hello guys,
I am a total newbie on R, having downloaded it, read the documentation and
started playing with it right now.

My general question is what 'lr' model can be used for doing a linear
regression on points that have a variance associated with them (ie. Monte
Carlo simulation results).

Actually my Data sets look like:

Timestep Energy Variance_of_the_Energy
0.0005 -14.876840 0.000670 
0.001 -14.883960 0.000670 
0.002 -14.887360 0.000700 
0.05 -14.888730 0.000430 
0.1 nan nan 

And what I want to do is to obtain the intercept of the best possible
linear fit (weeding out outliers if necessary) but having the intercept
with an associated error bar.

What I managed to do today is read the files from a table and learn how to
access the columns of the data frame . And managed to do a linear
regression of the type x ~ y with normal vectors.

I will eventually will like to use something like the leaps package
(regression subset selection) and then do a linear regression including
the error bars with the best points obtained by the 'leaps' package.

The specific questions are:
x. How can I Convert a data frame's column into a vector?
x. Now that I have the vectors, how can I specify a linear model of a
linear regression with associated variances?

Thanks a lot in advance!!

Alan Aspuru-Guzik

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list