[R] Linear Discriminant Analysis in R

cobbler_squad la.foma at gmail.com
Wed May 26 17:55:25 CEST 2010


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.



More information about the R-help mailing list