I think I see my problem. I was trying to enter the vector directly (i.e. [1/21, 1/21 1/21....] instead of using the symbolic language (i.e. ones(1/21)/21)). Using the symbolic terms works fine, while entering the fractions produces rounding errors.
Would you happen to have any insight on my other questions about corrected degrees of freedom in a full factorial, and differences in calculated covariances between the full and flexible factorials?
Thanks!
Allison
Allison Nugent
MRI Physicist
SNMAD/MIB/NIMH/NIH
Office: (301)451-8863
Mobile: (301)408-8560
[log in to unmask]
-----Original Message-----
From: Jan Gläscher [mailto:[log in to unmask]]
Sent: Friday, August 01, 2008 5:50 PM
To: Nugent, Allison C. (NIH/NIMH) [E]
Cc: [log in to unmask]
Subject: Re: [SPM] correctly specifying repeated measures mixed model in SPM5
Dear Allison,
I am running a little short on time, so I will only focus on the final part
of your email ...
Allison Nugent wrote:
> Also, I can't seem to enter many of the contrasts I'd like. For
> example, for the group contrast, since I have 21 in group 1 and 23 in group
> 2, the first 44 elements in the contrast would be:
> [ones(1,21)/21 ones(1,23)/23]
> (ala Jan Glascher's very helpful guide to contrasts)
> However, I get an error - because when matlab evaluates all those 1/21
> entries minus all the 1/23 entries, it produces something not quite zero -
> because of rounding errrors - since the contrast elements add up to 1E-15
> instead of 0, I'm told the contrast in unestimable. Does anyone know of a
> way around this?
You might want to verify that ones(1,23)/23 yields indeed a vector with
rounding errors. In order to do that type
format long
ones(1,23)/23
at the MATLAB prompt and see if you see rounding errors. On my machine, all
the number are identical and they add up to 1.
To get rid of them, you could potentially do the following:
round([ones(1,23)/23]*1000)/1000
in order to round it to the 3rd decimal. However, you might get the invalid
contrast error because then the weight won't sum up to 1 either, because of
the rounding error. (At least not on my machine.)
Cheers,
Jan
>
> Thanks for all your help!
>
> Allison
>
--
Jan Gläscher, Ph.D. Div. Humanities & Social Sciences
+1 (626) 395-3898 (office) Caltech, Broad Center, M/C 114-96
+1 (626) 395-2000 (fax) 1200 E. California Blvd
[log in to unmask] Pasadena, CA 91125
|