2
$\begingroup$

My experiment consists of two factors, one between and one within subject. Time is the between-subjects factor and hold two levels: (low and high). Times is the within-subject factors and hold three levels: 1, 4, 5. dv is my dependent variable, and id an identifier for each participant. I attached the data for the 6 first participants.

Using R, I ran an ANOVA that yielded significant results for both factors. I have two planned contrasts:

1) In time 1, I want to compare the two age groups (low vs high). That is, a between subject comparison.

2) In age low, I want to compare Time 1 and Time 5. That is, a within subject comparison.

Of course I could perform t-tests, yet it seems not appropriate as I can base my standard error estimate on more cells here. My question is how can I perform the above contrasts?

Here is my model using aov()

model= aov(dv ~ age*time + Error(id/time),
            data = Data)
summary(model)

And here is the data

Data = structure(list(id = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 
5L, 5L, 5L, 5L, 5L, 5L), .Label = c("1", "2", "3", "5", "6", 
"7", "8", "11", "12", "13", "15", "17", "18", "19", "20", "21", 
"22", "23", "24", "25", "27", "28", "29", "31", "32", "34", "35", 
"36", "37", "38", "39", "40", "42", "43", "44", "45", "46", "47", 
"48", "49", "52", "53", "54", "55", "56", "58", "59", "60", "62", 
"63", "64", "66", "67", "68", "69", "70", "71", "72", "73", "74", 
"75", "77", "79", "80", "81", "83", "84", "85", "86", "87", "88", 
"89", "90", "91", "92", "93", "94", "96", "97", "98", "99", "100", 
"101", "102", "103", "104", "105", "106", "107", "108", "109", 
"110", "111", "112", "113", "114", "115", "116", "117", "118", 
"119", "120", "121", "122", "123", "124", "125", "126", "127", 
"128", "129", "130", "132", "133", "134", "135", "136", "137", 
"138", "139", "140", "142", "143", "144", "145", "146", "147", 
"148", "149", "150", "151", "152", "153", "154", "156", "157", 
"158", "159", "160", "161", "162", "163", "165", "166", "167", 
"168", "169", "171", "172", "174", "175", "176", "177", "178", 
"179", "180", "181", "182", "183", "184", "185", "186", "187", 
"188", "189", "190", "191", "192", "193", "194", "195", "196", 
"200", "201", "202", "203", "204", "205", "206", "208", "209", 
"210", "212", "213", "214", "215", "216", "217", "218", "219", 
"220", "222", "223", "224", "226", "228", "230", "231", "232", 
"233", "234", "236", "237", "238", "239", "240", "241", "242", 
"243", "244", "246", "247", "248", "249", "250", "251", "252", 
"253", "254", "255", "256", "257", "258", "260", "261", "262", 
"263", "266", "267", "269", "270", "271", "272", "273", "274", 
"275", "276", "277", "278", "279", "280", "281", "282", "283", 
"284", "285", "286", "287", "288", "289", "290", "291", "292", 
"293", "294", "295", "296", "298", "299", "300"), class = "factor"), 
    age = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 
    2L, 2L, 2L, 2L, 2L), .Label = c("high", "low"), class = "factor"), 
    time = structure(c(3L, 3L, 2L, 2L, 1L, 1L, 3L, 3L, 2L, 2L, 
    1L, 1L, 3L, 3L, 2L, 2L, 1L, 1L, 3L, 3L, 2L, 2L, 1L, 1L, 3L, 
    3L, 2L, 2L, 1L, 1L), .Label = c("1", "4", "5"), class = "factor"), 
    dv = c(104, 102, 104, 103, 104, 104, 102, 102, 102, 102, 
    106, 106, 106, 106, 107, 107, 106, 106, 106, 107, 105, 104, 
    106, 107, 104, 101, 104, 101, 104, 106)), row.names = c(NA, 
-30L), class = c("tbl_df", "tbl", "data.frame"))
$\endgroup$

closed as off-topic by Stefan, Michael Chernick, Peter Flom Jan 24 at 10:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Stefan, Michael Chernick
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Did your model include an interaction between age and time? Also, can you share the command you used to assess the significance of age and time? $\endgroup$ – Isabella Ghement Jan 23 at 16:05
  • $\begingroup$ I just added the code. The model included the interaction. $\endgroup$ – Rtist Jan 23 at 16:28