Displaying 2 results from an estimated 2 matches for "tab1_1".
2009 Sep 28
1
help with lda function
...","x2")
d$x1 = d$x1 * 100
d$x2 = d$x2 * 100
g<-lda( y ~ x1 + x2, data=d)
v2 <- predict(g, d)",
I get;
LD1
1 -2.3769280
2 -2.7049437
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)
&...
2009 Sep 29
1
help with lda function from MASS package
...>>
>> I get;
>> LD1
>> 1 -2.3769280
>> 2 -2.7049437
>> 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)
>>>...