Hi Joris,
Thank you for taking the time to answer.

This data is of a test done for 39 subjects (from 2 groups) over 12 weeks.
And the questions I would like to answer are:
1) Did the test results changed over time?
2) Did the group effected the test results?
3) Did the effect of time differ for each group?

I understand that the general limitation of using repeated measures anova
here is (obviously) that even if one get's a significant "effect" of time,
the analysis doesn't give any clue as to how time influences the test (the
same goes for the interaction term).
But a more appropriate tool would probably be some sort of GAM lm, which is
based on models I don't have much understanding of (yet).

I am using this test since the researcher for whom I am doing the analysis
asked me to use it (since this is what was done in the previous work on
similar data, done by someone else).

Due to the current stage of my ignorance, and the researchers tendency
towards this analysis - I am not sure how to proceed.



Thanks,
Tal




----------------Contact
Details:-------------------------------------------------------
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Thu, May 6, 2010 at 2:25 PM, Joris Meys <jorism...@gmail.com> wrote:

> Hi Tal,
>
> The problem is not the analysis, but the data. You have 2 weeks that only
> have a value 4, and 31 out of 39 cases that only have a value 4. Your
> residual matrix is thus malformed, and has a lower rank than the amount of
> weeks minus 1. This makes it impossible to do the calculations in the Anova
> procedure. Even when dropping the weeks where the value is 4 for every case,
> the analysis can't be performed.
>
> Cheers
> Joris
>
> What is it you want to know exactly?
> On Thu, May 6, 2010 at 11:57 AM, Tal Galili <tal.gal...@gmail.com> wrote:
>
>> Hello all,
>>
>> I am getting the following error:
>>
>> Error in linear.hypothesis.mlm(mod, hyp.matrix.1, SSPE = SSPE, V = V,  :
>>  The error SSP matrix is apparently of deficient rank = 7 < 11
>>
>> After running:
>> mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
>> (av.ok <- Anova(mod.ok, idata=idata, idesign=~week))
>>
>> Although if I jitter the data in "dat", the function seems to work.
>>
>> What should I do ?
>>
>> (here is a self sufficient example code of my situation)
>>
>>
>>
>>
>>
>> #------------- R code --------------------
>>
>> # creating data
>> idata <- structure(list(week = structure(1:12, .Label = c("week6",
>> "week7",
>> "week8", "week9", "week10", "week11", "week12", "week13", "week14",
>>  "week15", "week16", "week17"), class = "factor")), .Names = "week",
>> row.names = c(NA,
>> -12L), class = "data.frame")
>>
>> dat <- structure(list(DC = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
>> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
>>  2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label =
>> c("control",
>> "head (20g)"), class = "factor"), week6 = c(4, 4, 4, 4, 4, 4,
>>  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
>> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), week7 = c(4, 4, 4, 4, 4,
>>  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
>> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), week8 = c(4, 4, 4, 4,
>>  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
>> 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 4), week9 = c(4, 4, 3,
>>  4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
>> 3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3), week10 = c(4, 4,
>>  3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4,
>> 4, 3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3), week11 = c(4,
>>  4, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3,
>> 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3), week12 = c(4,
>>  4, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3,
>> 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3), week13 = c(4,
>>  4, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
>> 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3), week14 = c(4,
>>  4, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
>> 4, 4, 2, 4, 3, 4, 4, 4, 4, 3, 4, 2, 4, 4, 4, 4, 3), week15 = c(4,
>>  4, 2, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
>> 4, 4, 1, 4, 3, 4, 4, 4, 4, 2, 4, 2, 4, 4, 4, 4, 3), week16 = c(4,
>>  4, 2, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
>> 4, 4, 0, 4, 3, 4, 4, 4, 4, 2, 4, 2, 4, 4, 4, 4, 3), week17 = c(4,
>>  4, 1, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
>> 4, 4, 0, 4, 2, 4, 4, 4, 4, 2, 4, 2, 4, 4, 4, 4, 3)), .Names = c("DC",
>>  "week6", "week7", "week8", "week9", "week10", "week11", "week12",
>> "week13", "week14", "week15", "week16", "week17"), class = c("cast_df",
>>  "data.frame"), row.names = c(NA, 39L))
>> # This fails
>> mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
>> (av.ok <- Anova(mod.ok, idata=idata, idesign=~week))
>>
>> # But this works
>> dat[,-1] <- apply(dat[,-1],2, jitter )
>> mod.ok <- lm(as.matrix(dat[,-1]) ~  DC, data=dat)
>> (av.ok <- Anova(mod.ok, idata=idata, idesign=~week))
>>
>> #------------- R code --------------------
>>
>>
>> Thanks in advance,
>> Tal
>>
>> ----------------Contact
>> Details:-------------------------------------------------------
>> Contact me: tal.gal...@gmail.com |  972-52-7275845
>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
>> www.r-statistics.com (English)
>>
>> ----------------------------------------------------------------------------------------------
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
> Joris Meys
> Statistical Consultant
>
> Ghent University
> Faculty of Bioscience Engineering
> Department of Applied mathematics, biometrics and process control
>
> Coupure Links 653
> B-9000 Gent
>
> tel : +32 9 264 59 87
> joris.m...@ugent.be
> -------------------------------
> Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to