[R] lm: how to calculate rsquared of the predicted values?

Henrik Bengtsson hb at stat.berkeley.edu
Sun Dec 9 04:05:32 CET 2007


Did you try to install using install.packages()?

> install.packages("caret")
Warning in install.packages("caret") :
  argument 'lib' is missing: using '/scratch5/hb/R/R_LIBS/linux/library/'

trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/caret_3.08.tar.gz'
Content type 'application/x-gzip' length 1428629 bytes (1.4 Mb)
opened URL
==================================================
downloaded 1.4 Mb

/server/scratch5/hb/R/R_LIBS/linux/library
* Installing *source* package 'caret' ...
** libs
gcc -std=gnu99 -I/usr/local/linux/R-2.6.1/include
-I/usr/local/linux/R-2.6.1/include  -I/usr/local/include    -fpic  -g
-O2 -c caret.c -o caret.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o caret.so caret.o
-L/usr/local/linux/R-2.6.1/lib -lR
** R
** data
** inst
** preparing package for lazy loading
Loading required package: lattice
** help
 >>> Building/Updating help pages for package 'caret'
     Formats: text html latex example

  BloodBrain                        text    html    latex
  applyProcessing                   text    html    latex   example
[snip]

The downloaded packages are in
        /tmp/Rtmpwxs3CH/downloaded_packages
> library(caret)
Loading required package: lattice
>

/Henrik


On 08/12/2007, Giovane <gufrgs at gmail.com> wrote:
> Thank you Max Kuhn,
>
> So I decided to install caret  (R version 2.6.0, gcc 4.1.2, caret 3.08,
> slackware 12 and kernel 2.6.17.11), and I've got a problem:
> R  CMD INSTALL caret
> * Installing to library '/usr/local/lib/R/library'
> * Installing *source* package 'caret' ...
> ** libs
> //(it goes with no problem..)
>
> //here comes the bug
>
> ** building package indices ...
> Error in load(zfile, envir = envir) : error reading from connection
> Calls: <Anonymous> ... .build_data_index -> list_data_in_pkg -> <Anonymous>
> -> switch -> load
> Execution halted
> ERROR: installing package indices failed
> ** Removing '/usr/local/lib/R/library/caret'
>
> Any ideas?
> On Dec 8, 2007 3:38 PM, Max Kuhn <mxkuhn at gmail.com> wrote:
>
> > >
> > > 1.  can I measure de R-squared value between the predicted(by the model)
> > and
> > > real (observed) values.?
> > > 2. Measure the RMSE error .
> > >
> >
> > There is a function in the caret package called postResample that will
> > do that (even if you aren't using resampling).
> >
> > As has been previously noted on this list, there are a number of
> > formulas for R-squared. This function uses the square of the
> > correlation between the observed and predicted. The next version of
> > caret will offer a choice of formulas.
> >
> > --
> >
> > Max
> >
>
>
>
> --
> Best regards,
>
> Giovane
>
>         [[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.
>



More information about the R-help mailing list