Hello,
I'm using earth function for Multivariate Adaptive Regression splines.
what is the significance of RSq in earth function??
following's the code.
printed value is of RSq.
> tr.wage<-sample(1:nrow(HCMwage), 0.8*nrow(HCMwage))
> tst.wage<- (1:nrow(HCMwage))[-tr.wage]
>
HCMwageModel<-earth(V2~V3+V4+V5+V6+V7+V8+V9+V10+V11+V12+W,data=HCMwage[tr.wage,])> prdHCMwage<-predict(HCMwageModel, newdata=HCMwage[tst.wage,])
> wg2HCM<-HCMwage$V2[tst.wage]
> RwageHCM<-(1-sum((wg2HCM - prdHCMwage)^2)/sum((wg2HCM-mean(wg2HCM))^2))
> print(RwageHCM)
[1] 0.3204129
Thanks and Regards,
Vibha
[[alternative HTML version deleted]]