search for: themod

Displaying 4 results from an estimated 4 matches for "themod".

Did you mean: themed
2008 May 09
1
Using lme() inside a function
...dataset as input variable and gives a prediction result (here mean absolute error) as output. This is an example using the Orthodont dataset: library(MASS) library(nlme) PredRes<-function(D1) { lmemod=lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14),method="ML") themod=stepAIC(lmemod,dir="both") prs=predict(themod,newdata=subset(D1,age==14)) obs<-subset(D1,age==14)$distance print(mean(obs-prs)) } Using this function with D1=Orthodont gives: > PredRes(Orthodont) Start: AIC=345.12 distance ~ age * Sex Error in subset(D1, age != 14) : objec...
2008 May 09
2
How can one make stepAIC and lme
...s the dataset as input variable and gives a prediction result (here mean absolute error) as output. This is an example using the Orthodont dataset: library(MASS) library(nlme) PredRes<-function(D1) { lmemod=lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14),method="ML") themod=stepAIC(lmemod,dir="both") prs=predict(themod,newdata=subset(D1,age==14)) obs<-subset(D1,age==14)$distance print(mean(obs-prs)) } Using this function with D1=Orthodont gives: > PredRes(Orthodont) Start: AIC=345.12 distance ~ age * Sex Error in subset(D1, age != 14) : object &...
2011 Mar 30
2
calculating the mode in R...
Dear R users I?m aware that the package ?modest? is useful to find the mode in an array. However, I?d like to know if someone has translated the ?mode? function built-in in MATLAB into R language. This function finds the most frequent value in an array (http://www.mathworks.com/help/techdoc/ref/mode.html). Best Fer
2010 Apr 22
6
simple question
Hi how can I find, in a vector of characters, which is the most frequent one? Thanks Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda MD Work: 301-451-8575 Mobile: 301-204-5642 Email: zoppolig at mail.nih.gov