anova2wayR - # # (find that the A:B interaction is not...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 ######################################### # Hypothetical data in a two-way table: # #b1b2b3 # ------------------------ # a1 | 3 | 2 | 1 | # | 5 | 7 | 4 | # ------------------------ # a2 | 6 | 7 | 4 | # | 10 | 12 | 6 | # ------------------------ # ########################################## # Copy and paste to the R command line: # Scan in the variables y = scan() 3 5 2 7 1 4 6 10 7 12 4 6 A = scan(what="") a1 a1 a1 a1 a1 a1 a2 a2 a2 a2 a2 a2 B = scan(what="") b1 b1 b2 b2 b3 b3 b1 b1 b2 b2 b3 b3 Dataset=data.frame(A,B,y) # put variables into data frame Dataset # display the data library(Rcmdr) # launch R commander ################## # To get the data into R commander: # Data tab --> Active data set --> Select active dataset --> Dataset ################## ################## # To run two-way anova: # Statistics tab --> Means --> Multiway anova #
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # # (find that the A:B interaction is not significant # the A main effect is signficant at level .05) ################## ################## Sheet1 Page 2 # To get full two-way anova model coefficients # Statistics tab --> Fit models --> Linear Model # response y, model A*B ################## ################## # To get reduced additive model coefficients # Statistics tab --> Fit models --> Linear Model # respones y, model A+B ################## #################################################### # Below here is how to run the same analyses using # the command line. #################################################### AnovaModel.1 = lm(y ~ A*B, data=Dataset) Anova(AnovaModel.1) summary(AnovaModel.1) AnovaModel.2 = lm(y ~ A + B, data=Dataset) Anova(AnovaModel.2) summary(AnovaModel.2)...
View Full Document

Page1 / 2

anova2wayR - # # (find that the A:B interaction is not...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online