Displaying 2 results from an estimated 2 matches for "nisq".
Did you mean:
nis
2007 Jan 23
1
How to evaluate an lm() object for generating warning statement in a function
...MStreat<-anovmod[1,3]; MSErr<-anovmod[2,3] #extract Mean
Squares
dataframe<- as.data.frame(object.lm[13]) #gets the data
that went into the lm
ni <- tapply(dataframe[,1], dataframe[,2], length) #number
of cases per treatment level
nisq<-ni^2
no<-(1/(length(ni)-1))*(sum(ni)-(sum(nisq)/sum(ni)))
#required to calculate variance components
s2a<-((MStreat-MSErr)/no)
stot<-s2a + MSErr
treatvar<-s2a/stot*100 #calculate variance components as
a percenta...
2007 Jan 22
0
Advice on an appropriate condition for warning in a function
...ded):
comp.var.estimates<-function(object.lm)
{
anovmod<-anova(object.lm) #get the anova table for the lm
MStreat<-anovmod[1,3]; MSErr<-anovmod[2,3] #extract Mean Squares
dataframe<- as.data.frame(object.lm[13])
ni <- tapply(dataframe[,1], dataframe[,2], length)
nisq<-ni^2
no<-(1/(length(ni)-1))*(sum(ni)-(sum(nisq)/sum(ni)))
s2a<-((MSTreat-MSErr)/no)
stot<-s2a + MSErr
treatvar<-s2a/stot*100
errorvar<-MSErr/stot*100
list(treat.var.comp=s2a, err.var.comp=MSErr,
p.var.treat=treatvar, p.var.err=errorvar)
}
comp.var.estimates(o...