FAQ
Hi all,

I can't figure out how to compute Wilks Lambda in a one way repeated
measure design. My matrix looks like:
t2.m
Blank ECR ENC UEA UED
1 -0.15 0.14 0.16 0.09 0.14
2 0.30 0.08 0.14 0.14 0.14
[...]

where each row is a case and the columns are levels of one factor (named
trial):
t2.fit <- manova(t2.m ~ 1)
summary(t2.fit, intercept=T, test="Wilks")
Df Wilks approx F num Df den Df Pr(>F)
(Intercept) 1 0.26869 1.63302 5 3 0.3642
Residuals 7

ist this correct? I ask because SPSS gives me a different result:

Effect: Trial
Wilks: 0.392
F: 1.554
Df: 4
error Df: 4
Pr: 0.340

Thanks for any hints, Sven

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

## Search Discussions

•  at Mar 21, 2002 at 6:12 pm ⇧

Hi all,

I can't figure out how to compute Wilks Lambda in a one way repeated
measure design. My matrix looks like:
t2.m
Blank ECR ENC UEA UED
1 -0.15 0.14 0.16 0.09 0.14
2 0.30 0.08 0.14 0.14 0.14
[...]

where each row is a case and the columns are levels of one factor (named
trial):
t2.fit <- manova(t2.m ~ 1)
summary(t2.fit, intercept=T, test="Wilks")
Df Wilks approx F num Df den Df Pr(>F)
(Intercept) 1 0.26869 1.63302 5 3 0.3642
Residuals 7

ist this correct? I ask because SPSS gives me a different result:

Effect: Trial
Wilks: 0.392
F: 1.554
Df: 4
error Df: 4
Pr: 0.340

Thanks for any hints, Sven
Hmm. The ways of SPSS are sometimes mysterious, but the Df suggest
that you're testing that the 5 variables all have mean zero, whereas
SPSS might be testing whether they have the *same* mean. You can check
that by looking at

t2.m2 <- t2.m[,-1] - t2.m[,1]
t2.fit <- manova(t2.m ~ 1)

--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
•  at Mar 22, 2002 at 12:06 am ⇧

Peter Dalgaard BSA wrote:
Hi all,

I can't figure out how to compute Wilks Lambda in a one way repeated
measure design. My matrix looks like:
t2.m
Blank ECR ENC UEA UED
1 -0.15 0.14 0.16 0.09 0.14
2 0.30 0.08 0.14 0.14 0.14
[...]

where each row is a case and the columns are levels of one factor (named
trial):
t2.fit <- manova(t2.m ~ 1)
summary(t2.fit, intercept=T, test="Wilks")
Df Wilks approx F num Df den Df Pr(>F)
(Intercept) 1 0.26869 1.63302 5 3 0.3642
Residuals 7

ist this correct? I ask because SPSS gives me a different result:

Effect: Trial
Wilks: 0.392
F: 1.554
Df: 4
error Df: 4
Pr: 0.340

Thanks for any hints, Sven
Hmm. The ways of SPSS are sometimes mysterious, but the Df suggest
that you're testing that the 5 variables all have mean zero, whereas
SPSS might be testing whether they have the *same* mean. You can check
that by looking at

t2.m2 <- t2.m[,-1] - t2.m[,1]
t2.fit <- manova(t2.m ~ 1)
Thanks, that is exactly what I was looking for. Indeed I need to test
that the 5 variables all have mean zero. But I haven't found anything in
the SPPS doc about what SPSS did, so I got confused.

Thanks & regards, Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
•  at Mar 22, 2002 at 4:19 am ⇧
Dear R users and developers:

I got this message when I try to make the summary of a numeric variable,
summary(Dep)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000e+00 1.192e+07 2.739e+07 6.538e+07 1.858e+09
Warning message:
Integer overflow in sum(.); use sum(as.numeric(.))

and it fails to make the sum (for calculate the mean), but I don't
understand the "Integer overflow"

If I type the following command,
summary(as.numeric(Dep))
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000e+00 1.192e+07 2.739e+07 5.306e+07 6.538e+07 1.858e+09

it works fine.... but I still don't undertand way it doesn't work without
the "as.numeric" coerce, when other functions like "sd()" worked fine.

Kenneth Cabrera

P.S.: The length of Dep is 5297
And I am working on W2K in R1.4.1. version.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020321/d6f73da4/attachment.html
•  at Mar 22, 2002 at 7:30 am ⇧

On Thu, 21 Mar 2002, Kenneth Cabrera wrote:

Dear R users and developers:

I got this message when I try to make the summary of a numeric variable,
It's not really numeric = double: it is integer. Try typeof(Dep).
summary(Dep)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000e+00 1.192e+07 2.739e+07 6.538e+07 1.858e+09
Warning message:
Integer overflow in sum(.); use sum(as.numeric(.))

and it fails to make the sum (for calculate the mean), but I don't
understand the "Integer overflow"

If I type the following command,
summary(as.numeric(Dep))
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000e+00 1.192e+07 2.739e+07 5.306e+07 6.538e+07 1.858e+09

it works fine.... but I still don't undertand way it doesn't work without
the "as.numeric" coerce, when other functions like "sd()" worked fine.
Because a sum of integers is considered to be an integer, and mean(x)
is sum(x)/length(x) (in essence). I think mean should coerce integers (or
logicals) to double.

--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
•  at Mar 22, 2002 at 8:52 am ⇧
I sent a similar message to R-help a few months ago with the same subject!

The basic problem is that sum doesn't automatically coerce to double,
which suprised both you and me. Thus you got integer overflow (doubles
have a much larger dynamic range so won't overflow).

If you had done sum(dep*1.0) that would
have worked as well because operations like * and / do return a double
result, and sum() on a double returns a double.
x<-1:10
sum(x) [1] 55
is.double(sum(x)) [1] FALSE
is.double(sum(x*1)) [1] TRUE
is.double(sum(x+0))
[1] TRUE

It's confusing to me how numbers are stored as integer:
is.integer(x) [1] TRUE
is.integer(x+0) [1] FALSE
is.integer(x+x) [1] TRUE
y<-0
is.integer(y) [1] FALSE
is.integer(x+y) [1] FALSE
y<-0:0
is.integer(y) [1] TRUE
is.integer(x+y)
[1] TRUE

Bill

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

## Related Discussions

Discussion Overview
 group r-help categories r posted Mar 21, '02 at 12:53p active Mar 22, '02 at 8:52a posts 6 users 5 website r-project.org irc #r

### 5 users in discussion

Content

People

Support

Translate

site design / logo © 2018 Grokbase