[R] I need help in analyzing
Joris Meys
jorismeys at gmail.com
Sun Jun 6 13:31:54 CEST 2010
This help list is not intended for solving your assignments. But
you're honest about it, so I'll describe for you shortly what the
output is. How to interprete that output is up to you.
see inline comments.
On Sun, Jun 6, 2010 at 12:38 PM, wojak121 <rotworm121 at op.pl> wrote:
>
> I'm sory for my weak english. I need to analyze this subject :
> last column is my Y. When i entered this to R i've get
> model.lda=lda(y~.,dane)
> Warning message:
> In lda.default(x, grouping, ...) : variables are collinear
Obvious warning message, and the indication that there are other
methods maybe more suited for your data.
>> model.lda
> Call:
> lda(y ~ ., data = dane)
what you put in
>
> Prior probabilities of groups:
> blond braz czarne rude
> 0.3166667 0.2833333 0.2333333 0.1666667
The proportions of each hair type in the original dataset
>
> Group means:
> x1 x2 x3 x4 x5 x6 x7
> blond 0.3684211 0.1578947 0.4736842 0.4210526 0.2105263 0.3684211 0.3684211
> braz 0.2941176 0.2941176 0.6470588 0.3529412 0.0000000 0.4117647 0.2352941
> czarne 0.3571429 0.1428571 0.7142857 0.4285714 0.0000000 0.3571429 0.3571429
> rude 0.4000000 0.3000000 0.8000000 0.0000000 0.0000000 0.6000000 0.6000000
> x8 x9 x10
> blond 0.10526316 0.1578947 0.3684211
> braz 0.05882353 0.1764706 0.5294118
> czarne 0.00000000 0.2142857 0.4285714
> rude 0.10000000 0.1000000 0.2000000
Proportion of "yes" answers for every hair type, and this for each x variable.
>
> Coefficients of linear discriminants:
> LD1 LD2 LD3
> x1 5.1043768 4.0739211 -2.3626627
> x2 5.1972181 2.9748157 -0.3920615
> x3 5.9721912 3.0080526 -2.1908394
> x4 3.9526576 2.7992826 -2.4115814
> x5 2.0778084 5.5095145 -1.6788562
> x6 4.9891371 3.5497498 -1.4580874
> x7 0.6484504 0.5349203 -0.4412781
> x8 -2.2934686 0.8713075 1.4076988
> x9 -0.3536417 -0.2746371 -0.4208209
> x10 0.2013050 -0.5773421 0.3025799
How the x variables combine into the linear discriminant functions.
>
> Proportion of trace:
> LD1 LD2 LD3
> 0.6918 0.2574 0.0508
Can be interpreted as the relative importance of every discriminant
function (sum up to 1)
>
>> w=sample(1:60,20)
>> test=dane[w,]
>> ucz=dane[-w,]
>> m=lda(y~.,ucz)
>> test.x=test[,-11]
>> klasyfikacja=predict(m,test.x)
>> table(klasyfikacja$class,test$y)
>
> blond braz czarne rude
> blond 2 1 1 0
> braz 2 3 2 1
> czarne 0 2 2 0
> rude 1 1 1 1
misclassification table
>
> model=rpart(y~.,dane,method="class",control=rpart.control(xval=3,cp=0))
>> plot(model)
>> text(model)
> model$cptable
> CP nsplit rel error xerror xstd
> 1 0.05691057 0 1.0000000 1.097561 0.08180737
> 2 0.02439024 3 0.8292683 1.219512 0.07040857
> 3 0.00000000 4 0.8048780 1.195122 0.07310295
the table of optimal prunings
> npt=which.min(model$table[,4])
>> npt
> integer(0)
nothing. there's no "table" in the model object. try
npt = which.min(model$cptable[,4])
This gives you the rownumber of the pruning with minimal standard deviation.
>
>
>
> I need to describe this subject, but i don't know what R is saying to me.
> This subject is about what women hairs mens like. x1 to x10 are answers to
> questions 1 is yes,0 is no, but there was 2 groups of questions; from x1 to
> x6 it must be choisen 2 answers on yes and from x7 to x 10 only 1 on yes.
> Help me please, i need this to pass this subject.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/I-need-help-in-analyzing-tp2244886p2244886.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>
--
Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control
tel : +32 9 264 59 87
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
More information about the R-help
mailing list