Why exactly do you need lda and not another method? For lda to be
applicable, you should check :
1) whether the regressors are normally distributed within the classes
2) whether the variance-covariance matrices are equal for all classes

Essentially, this means that the boundary between both classes is a
hyperplane (or in 2 dimensions, a straight line). Otherwise you can try qda,
or go to other supervised learning methods.

How to use lda is explained rather well in the help files. if it doesn't
work, provide us with self-contained code (i.e. code that can be run without
need of extra information like data frames) that reproduces the error.

Cheers
Joris

PS : There's an error in your code.
scaled_features <- scale(mask_features, center = FALSE, scale =
apply(abs(mask_features, 2, median)))

should be
scaled_features <- scale(mask_features, center = FALSE, scale =
apply(abs(mask_features), 2, median))


On Wed, May 26, 2010 at 5:55 PM, cobbler_squad <la.foma@gmail.com> wrote:

>
> Dear R gurus,
>
> Thank you all for continuous support and guidance -- learning without you
> would not be efficient.
>
> I have a question regarding LD analysis and how to best code it up in R.
>
> I have a file of (V52 and 671 time points across all columns) and another
> file of phonetic features (each vowel is aligned with a distinct binary
> sequence, i.e.
> E 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 and so on). I need to
> run lda (at first for one of the features, meaning one column only
> extracted
> from the "binary" file mentioned above). In code so far I have very little,
> but here the short examples of both files:
> V57 file:
>
>              V27       V28           V29       V30           V31       V32
> V33       V34
> 1   -2.515000e-03 -0.203858  6.531000e-03  0.248686  6.760000e-04  0.084677
> -1.262000e-03
> 2   -2.406000e-03 -0.194943  6.248000e-03  0.237851  6.470000e-04  0.081001
> -1.207000e-03
> 3   -4.860000e-04 -0.039288  1.263000e-03  0.047980  1.300000e-04  0.016292
> -2.430000e-04
>
> and "binary" file
>
>    V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20
> V21 V22 V23 V24 V25 V26
> 1    E  0  0  0  0  0  0  0  0   0   0   0   0   1   1   0   0   0   1   0
> 0   0   0   0   0   0
> 2    o  0  0  0  0  0  0  0  0   0   0   0   0   1   0   0   1   0   1   0
> 1   0   1   0   0   0
> 3    I  0  0  0  0  0  0  0  0   0   0   0   0   1   1   0   0   1   0   0
> 0   0   0   0   0   0
>
> thus in code I have the following:
>
> library(MASS)
>
> vowel_features <- read.table(file = "mappings_for_vowels.txt")
> mask_features <- read.table(file = "3dmaskdump_ICA_37_Combined.txt")
>
> #scale the mask_features file
>
> scaled_features <- scale(mask_features, center = FALSE, scale =
> apply(abs(mask_features, 2, median)))
>
> #input vowel feature, lda
>
> lda(ROI_values ~ mappings_for_vowels[15]...)
>
> not sure what is the correct approach to use for lda
>
> any pointers would be greatly appreciated
>
> thanks again all!
>
> Cobbler
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Linear-Discriminant-Analysis-in-R-tp2231922p2231922.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@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.
>



-- 
Joris Meys
Statistical Consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

Coupure Links 653
B-9000 Gent

tel : +32 9 264 59 87
Joris.Meys@Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]

