[R] R2
Uwe Ligges
ligges at statistik.tu-dortmund.de
Tue Dec 29 17:11:43 CET 2009
Gabor Grothendieck wrote:
> ** works as exponentiation for me:
>
>> 3**2
> [1] 9
Yes, but see ?"**" that it is just documented in a note and has been
deprecated in S since 20 years...
Uwe Ligges
>
> On Tue, Dec 29, 2009 at 6:10 AM, Phil Spector <spector at stat.berkeley.edu> wrote:
>> Nancy -
>> Please notice that ** is not an R operator. The caret (^) is the
>> exponentiation operator in R.
>> - Phil
>>
>>
>>
>> On Tue, 29 Dec 2009, Nancy Adam wrote:
>>
>>> Hi everyone,
>>> I tried to write the code of computing R2 for a regression system but I
>>> failed.
>>> This is the code I use for computing RMSE:
>>>
>>> my_svm_model <- function(myformula, mydata, mytestdata)
>>> {
>>> mymodel <- svm(myformula, data=mydata)
>>> mytest <- predict(mymodel, mytestdata)
>>> error <- mytest - mytestdata[,1]
>>> -sqrt(mean(error**2))
>>>
>>> }
>>> can anyone please tell me what I have to change to compute R2 instead of
>>> RMSE?
>>>
>>> Many thanks,
>>> Nancy
>>> _________________________________________________________________
>>>
>>>
>>> [[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.
>>>
>> ______________________________________________
>> 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.
>>
>
> ______________________________________________
> 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