Displaying 6 results from an estimated 6 matches for "xbar1".
Did you mean:
bar1
2000 Sep 19
3
coerce mode list?
...462
> W1
VAR00003 VAR00004 VAR00005 VAR00006 VAR00007
1 0 1 0 1 0
2 1 0 0 0 1
3 0 0 0 0 1
4 1 0 0 0 0
5 0 1 1 0 0
> Xbar1 <- mean(X1)
> S1 <- (t(X1 - Xbar1)) %*% W1 %*% (X1 - Xbar1)
Error in as.double: Cannot coerce mode list to double:
.Data = list(..
Dumped
> S1 <- (t(as.double(X1 - Xbar1))) %*% W1 %*%
(as.double(X1 - Xbar1))
Error in as.double: Cannot coerce mode list to double:
.Data = list(..
Dumpe...
2009 Sep 28
1
help with lda function
...3 -3.4748309
4 -0.9599825
5 4.2293774
6 2.6052193
7 2.6820884
However, If I do it manually,
"rawdata<-matrix(scan("tab1_1.
>
> dat"),ncol=3,byrow=T)
> group <- rawdata[,1]
> X <- 100 * rawdata[,2:3]
> Apf <- X[group==1,]
> Af <- X[group==0,]
> xbar1 <- apply(Af, 2, mean)
> S1 <- var(Af)
> N1 <- dim(Af)[1]
> xbar2 <- apply(Apf, 2, mean)
> S2 <- var(Apf)
> N2 <- dim(Apf)[1]
> S<-((N1-1)*S1+(N2-1)*S2)/(N1+N2-2)
> Sinv=solve(S)
> d<-xbar1-xbar2
> b <- Sinv %*% d
> v <- X %*% b",
>...
2012 Jun 04
1
simulation of modified bartlett's test
...,n2),rep(3,n3))
N=60
k=3
v1=var(g1)
v2=var(g2)
v3=var(g3)
#pooled variance
A=((n1-1)*v1+(n2-1)*v2+(n3-1)*v3)/(N-k)
#calculate B
B=((N-k)*(log(A)))-((n1-1)*log(v1)+(n2-1)*log(v2)+(n3-1)*log(v3))
#calculate C
C=1+(1/(3*(k-1))*(((1/(n1-1))+(1/(n2-1))+(1/(n3-1)))-(1/(N-k))))
#calculate layard estimator
xbar1=mean(g1)
xbar2=mean(g2)
xbar3=mean(g3)
sum1=sum((g1-xbar1)^4)
sum2=sum((g2-xbar2)^4)
sum3=sum((g3-xbar3)^4)
sum4=sum((g1-xbar1)^2)
sum5=sum((g2-xbar2)^2)
sum6=sum((g3-xbar3)^2)
y= (N*(sum1+sum2+sum3))/((sum4+sum5+sum6)^2)
#calculate bartlett modified statistic
bar2=B/(C*(1/2)*(y-1))
bar2
pv[i]<-...
2009 Sep 29
1
help with lda function from MASS package
...it manually,
>>
>> "rawdata<-matrix(scan("tab1_1.
>>
>>>
>>> dat"),ncol=3,byrow=T)
>>> group <- rawdata[,1]
>>> X <- 100 * rawdata[,2:3]
>>> Apf <- X[group==1,]
>>> Af <- X[group==0,]
>>> xbar1 <- apply(Af, 2, mean)
>>> S1 <- var(Af)
>>> N1 <- dim(Af)[1]
>>> xbar2 <- apply(Apf, 2, mean)
>>> S2 <- var(Apf)
>>> N2 <- dim(Apf)[1]
>>> S<-((N1-1)*S1+(N2-1)*S2)/(N1+N2-2)
>>> Sinv=solve(S)
>>> d<-xbar...
1998 Nov 16
1
PB Mandeville can't be reached
# Peter B. Mandeville kindly offered to send me code for Hotelling's T^2
# Test. Unfortunately there seems to be no route to his machine.
# So i'm trying to reach him via the Mailing List.
------------------------------------------------------------------------
Sir,
this morning i recieved your message about the availability of the code
for Hotelling's Test. I hurried to find out
1998 Nov 16
0
Re: Hotelling corrected
By accident, I left out the lines defining n1 and n2. Here it is as a
function.
Peter B.
hotelling <- function(d1,d2){
k <- ncol(d1)
n1 <- nrow(d1)
n2 <- nrow(d2)
xbar1 <- apply(d1,2,mean)
xbar2 <- apply(d2,2,mean)
dbar <- xbar2-xbar1
v <- ((n1-1)*var(d1)+(n2-1)*var(d2))/(n1+n2-2)
t2 <- n1*n2*dbar%*%solve(v)%*%dbar/(n1+n2)
f <- (n1+n2-k-1)*t2/((n1+n2-2)*k)
cat("F:",f,"\n")
cat("PROBABILITY:&quo...