User Tools

Site Tools


c:ma:2019:lecturer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
c:ma:2019:lecturer [2019/10/03 07:10] – [anova: mtcars] hkimscilc:ma:2019:lecturer [2019/10/04 11:28] (current) – [anova: mtcars] hkimscil
Line 231: Line 231:
 } }
  
-data <- mtcars +library(MASS) 
-x <- mtcars$am + 
-y <- mtcars$mpg+tempd <- iris 
 +x <- tempd$Species 
 +y <- tempd$Sepal.Width 
 + 
 +tempd <- mtcars 
 +<- tempd$gear 
 +y <- tempd$mpg 
 + 
 +tempd <- mtcars 
 +x <- tempd$am 
 +y <- tempd$mpg 
  
 x <- factor(x) x <- factor(x)
Line 245: Line 256:
 ssbetween <- sstotal-sswithin ssbetween <- sstotal-sswithin
  
-round(sswithin,0+round(sswithin,2
-round(ssbetween,0+round(ssbetween,2
-round(sstotal,0)+round(sstotal,2)
  
 dfwithin <- sum(stats[4,]) dfwithin <- sum(stats[4,])
Line 260: Line 271:
 mstotal <- sstotal / dftotal mstotal <- sstotal / dftotal
  
-round(mswithin,0+round(mswithin,2
-round(msbetween,0+round(msbetween,2
-round(mstotal,0)+round(mstotal,2)
  
 fval <- round(msbetween/mswithin,2) fval <- round(msbetween/mswithin,2)
 fval fval
-siglevel <- pf(q=36.18, df1=2, df2=29, lower.tail=FALSE)+siglevel <- pf(q=fval, df1=dfbetween, df2=dfwithin, lower.tail=FALSE)
 siglevel siglevel
  
-mod <- aov(y~x, data=data)+mod <- aov(y~x, data=tempd)
 summary(mod) summary(mod)
  
c/ma/2019/lecturer.1570054214.txt.gz · Last modified: 2019/10/03 07:10 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki