[R] help setting up crossed data

derrick derrick.cox at umit.maine.edu
Sun Dec 2 18:17:28 CET 2012


Hello, and thanks for your time reading this.   I'm trying to test
interactions of my dataset, in which the all of the factors are within the
same column.  
	Type	Vol
1	CMass	-4.598
2	BBack	-4.605
3	BMass	-4.602
4	CMass	-4.601
5	CBack	-4.605
6	CMass	-4.604
7	CMass	-4.602
8	CMass	-4.604
9	CBack	-4.605
10	BBack	-4.503
11	CMass	-4.605

Im attempting to determine the interaction effects of B or C on Mass and
Back
Looking for a set up as such Volume ~ CorB + MassorBack + CorB:MassorBack
is there an easy way to arrange the data so I can have the factors in column
1 broken down as I'd like?  

Here if my current setup of the situation, In which I don't consider the
interactions.  please forgive the armature coding.

if (T) {
  #Arrange all data in a 2 column matrix as such: [Tissue Type, Measure]
  measure = matrix(NA,4812,2)
  measure=data.frame(measure)
  for (i in a:b) {
    #loads threshold factor
    measure[,1] = data[,1]
    #loads ith threshold
    measure[,2] = data[,i]
    measure$X1=factor(measure$X1, levels =
c('CMass','BMass','CBack','BBack'))
    measure.aov= aov(X2 ~ X1,data = measure)
    #prints results
    print(TukeyHSD(measure.aov, order= TRUE, conf.level = .995))
  }
}







--
View this message in context: http://r.789695.n4.nabble.com/help-setting-up-crossed-data-tp4651674.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list