This shows you the differences between two versions of the page.
neuroimagen:altdti [2019/03/22 10:25] osotolongo [Todas las redes] |
neuroimagen:altdti [2020/08/04 10:58] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== experimento DTI ====== | ||
- | |||
- | ==== pruebas ==== | ||
- | |||
- | Siguiendo los pasos de la [[neuroimagen: | ||
- | |||
- | El archivo // | ||
- | |||
- | <code bash> | ||
- | grep ctx / | ||
- | </ | ||
- | Estas regiones son, | ||
- | < | ||
- | 1003 ctx-lh-caudalmiddlefrontal | ||
- | 1008 ctx-lh-inferiorparietal | ||
- | 1012 ctx-lh-lateralorbitofrontal | ||
- | 1014 ctx-lh-medialorbitofrontal | ||
- | 1027 ctx-lh-rostralmiddlefrontal | ||
- | 1028 ctx-lh-superiorfrontal | ||
- | 1029 ctx-lh-superiorparietal | ||
- | 1032 ctx-lh-frontalpole | ||
- | 2003 ctx-rh-caudalmiddlefrontal | ||
- | 2008 ctx-rh-inferiorparietal | ||
- | 2012 ctx-rh-lateralorbitofrontal | ||
- | 2014 ctx-rh-medialorbitofrontal | ||
- | 2027 ctx-rh-rostralmiddlefrontal | ||
- | 2028 ctx-rh-superiorfrontal | ||
- | 2029 ctx-rh-superiorparietal | ||
- | 2032 ctx-rh-frontalpole | ||
- | 1106 ctx-lh-G_frontal_inf-Opercular_part | ||
- | 1107 ctx-lh-G_frontal_inf-Orbital_part | ||
- | 1108 ctx-lh-G_frontal_inf-Triangular_part | ||
- | 1109 ctx-lh-G_frontal_middle | ||
- | 1110 ctx-lh-G_frontal_superior | ||
- | 1122 ctx-lh-G_parietal_inferior-Angular_part | ||
- | 1123 ctx-lh-G_parietal_inferior-Supramarginal_part | ||
- | 1124 ctx-lh-G_parietal_superior | ||
- | 1154 ctx-lh-S_frontal_inferior | ||
- | 1155 ctx-lh-S_frontal_middle | ||
- | 1156 ctx-lh-S_frontal_superior | ||
- | 1159 ctx-lh-S_intraparietal-and_Parietal_transverse | ||
- | 1177 ctx-lh-S_subparietal | ||
- | 2106 ctx-rh-G_frontal_inf-Opercular_part | ||
- | 2107 ctx-rh-G_frontal_inf-Orbital_part | ||
- | 2108 ctx-rh-G_frontal_inf-Triangular_part | ||
- | 2109 ctx-rh-G_frontal_middle | ||
- | 2110 ctx-rh-G_frontal_superior | ||
- | 2122 ctx-rh-G_parietal_inferior-Angular_part | ||
- | 2123 ctx-rh-G_parietal_inferior-Supramarginal_part | ||
- | 2124 ctx-rh-G_parietal_superior | ||
- | 2154 ctx-rh-S_frontal_inferior | ||
- | 2155 ctx-rh-S_frontal_middle | ||
- | 2156 ctx-rh-S_frontal_superior | ||
- | 2159 ctx-rh-S_intraparietal-and_Parietal_transverse | ||
- | 2177 ctx-rh-S_subparietal | ||
- | </ | ||
- | |||
- | El resultado de // | ||
- | |||
- | {{ : | ||
- | |||
- | Ahora voy a quitar los giros y demas y quedarme solo con las 16 primeras lineas. | ||
- | <code bash> | ||
- | $ cat dti_track.seed | ||
- | 1003 | ||
- | 1008 | ||
- | 1012 | ||
- | 1014 | ||
- | 1027 | ||
- | 1028 | ||
- | 1029 | ||
- | 1032 | ||
- | 2003 | ||
- | 2008 | ||
- | 2012 | ||
- | 2014 | ||
- | 2027 | ||
- | 2028 | ||
- | 2029 | ||
- | 2032 | ||
- | </ | ||
- | |||
- | La red que obtengo es ahora bastante similar, | ||
- | |||
- | {{ : | ||
- | |||
- | Aplicando esta red como mascara (25%) saco los datos de FA en la red y los puedo comparar con otros datos . Ejemplo, SUVR en la misma visita, | ||
- | |||
- | {{ : | ||
- | |||
- | ==== Aislando el cortex ==== | ||
- | |||
- | Voy a intentar aislar todas las regiones del cortex para hacer una lista de lo que puedo parcelar | ||
- | <code bash> | ||
- | $ grep ctx / | ||
- | </ | ||
- | y me quedo con los nombres utiles para que un neurologo me edite la lista, | ||
- | < | ||
- | ctx-bankssts | ||
- | ctx-caudalanteriorcingulate | ||
- | ctx-caudalmiddlefrontal | ||
- | ctx-corpuscallosum | ||
- | ctx-cuneus | ||
- | ctx-entorhinal | ||
- | ctx-fusiform | ||
- | ctx-inferiorparietal | ||
- | ctx-inferiortemporal | ||
- | ctx-isthmuscingulate | ||
- | ctx-lateraloccipital | ||
- | ctx-lateralorbitofrontal | ||
- | ctx-lingual | ||
- | ctx-medialorbitofrontal | ||
- | ctx-middletemporal | ||
- | ctx-parahippocampal | ||
- | ctx-paracentral | ||
- | ctx-parsopercularis | ||
- | ctx-parsorbitalis | ||
- | ctx-parstriangularis | ||
- | ctx-pericalcarine | ||
- | ctx-postcentral | ||
- | ctx-posteriorcingulate | ||
- | ctx-precentral | ||
- | ctx-precuneus | ||
- | ctx-rostralanteriorcingulate | ||
- | ctx-rostralmiddlefrontal | ||
- | ctx-superiorfrontal | ||
- | ctx-superiorparietal | ||
- | ctx-superiortemporal | ||
- | ctx-supramarginal | ||
- | ctx-frontalpole | ||
- | ctx-temporalpole | ||
- | ctx-transversetemporal | ||
- | ctx-insula | ||
- | </ | ||
- | |||
- | ==== Mapa FP MB ==== | ||
- | |||
- | Las regiones escogidas son, | ||
- | |||
- | < | ||
- | ctx-caudalmiddlefrontal | ||
- | ctx-inferiorparietal | ||
- | ctx-middletemporal | ||
- | ctx-parsopercularis | ||
- | ctx-parstriangularis | ||
- | ctx-postcentral | ||
- | ctx-precentral | ||
- | ctx-superiorfrontal | ||
- | ctx-superiorparietal | ||
- | ctx-superiortemporal | ||
- | ctx-supramarginal | ||
- | </ | ||
- | |||
- | Voy a quedarme con lo que necesito ahora, | ||
- | |||
- | <code bash> | ||
- | $ grep ctx / | ||
- | $ cat tocut.txt | ||
- | caudalmiddlefrontal | ||
- | inferiorparietal | ||
- | middletemporal | ||
- | parsopercularis | ||
- | parstriangularis | ||
- | postcentral | ||
- | precentral | ||
- | superiorfrontal | ||
- | superiorparietal | ||
- | superiortemporal | ||
- | supramarginal | ||
- | $ grep -f tocut.txt tofp.txt | awk {' | ||
- | $ cat dti_track.seed | ||
- | 1003 | ||
- | 1008 | ||
- | 1015 | ||
- | 1018 | ||
- | 1020 | ||
- | 1022 | ||
- | 1024 | ||
- | 1028 | ||
- | 1029 | ||
- | 1030 | ||
- | 1031 | ||
- | 2003 | ||
- | 2008 | ||
- | 2015 | ||
- | 2018 | ||
- | 2020 | ||
- | 2022 | ||
- | 2024 | ||
- | 2028 | ||
- | 2029 | ||
- | 2030 | ||
- | 2031 | ||
- | </ | ||
- | |||
- | con estas seeds ya puedo correr el experimento. | ||
- | |||
- | <code bash> | ||
- | $ dti_track.pl facehbi | ||
- | ... 3dias ... | ||
- | $ cd / | ||
- | $ for x in `ls -d working/ | ||
- | $ dti_metrics_alt.pl -path FPCustom facehbi | ||
- | |||
- | $ dti_track.pl v2MriPet | ||
- | ... 3dias ... | ||
- | $ cd / | ||
- | $ for x in `ls -d working/ | ||
- | $ dti_metrics_alt.pl -path FPCustom v2MriPet | ||
- | </ | ||
- | === Comparando con DMN === | ||
- | |||
- | Sorprendentemente, | ||
- | |||
- | <code R> | ||
- | > summary(v1m) | ||
- | |||
- | Call: | ||
- | lm(formula = DMN_FA_v1 ~ FPCustom_FA_v1, | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -0.031888 -0.006546 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | FPCustom_FA_v1 | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.01099 on 152 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | {{: | ||
- | |||
- | <code R> | ||
- | > summary(v2m) | ||
- | |||
- | Call: | ||
- | lm(formula = DMN_FA_v2 ~ FPCustom_FA_v2, | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -0.036853 -0.005949 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | FPCustom_FA_v2 | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.01042 on 152 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | {{: | ||
- | |||
- | === Modelo mixto === | ||
- | |||
- | Nada raro, la relacion con el SUVR va mas o menos igual. | ||
- | |||
- | <code R> | ||
- | > model.a <- lm(Custom_FA ~ SUVR , data=idata) | ||
- | > summary(model.a) | ||
- | |||
- | Call: | ||
- | lm(formula = Custom_FA ~ SUVR, data = idata) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -0.055969 -0.015556 -0.001559 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | SUVR -0.011063 | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.02038 on 306 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > model.c <- lme(Custom_FA ~ SUVR, random = ~ 1| Subject, data=idata) | ||
- | > summary(model.c) | ||
- | Linear mixed-effects model fit by REML | ||
- | Data: idata | ||
- | | ||
- | -1566.58 -1551.686 787.29 | ||
- | |||
- | Random effects: | ||
- | | ||
- | (Intercept) | ||
- | StdDev: | ||
- | |||
- | Fixed effects: Custom_FA ~ SUVR | ||
- | Value | ||
- | (Intercept) | ||
- | SUVR -0.01097326 0.007035937 153 -1.55960 | ||
- | | ||
- | | ||
- | SUVR -0.986 | ||
- | |||
- | Standardized Within-Group Residuals: | ||
- | Min Q1 | ||
- | -2.10991932 -0.50342918 -0.01151992 | ||
- | |||
- | Number of Observations: | ||
- | Number of Groups: 154 | ||
- | |||
- | > anova(model.c, | ||
- | Model df | ||
- | model.c | ||
- | model.a | ||
- | |||
- | > model.b <- lmer(Custom_FA ~ SUVR + (1| Subject), data=idata) | ||
- | > summary(model.b) | ||
- | Linear mixed model fit by REML [' | ||
- | Formula: Custom_FA ~ SUVR + (1 | Subject) | ||
- | Data: idata | ||
- | |||
- | REML criterion at convergence: | ||
- | |||
- | Scaled residuals: | ||
- | | ||
- | -2.10992 -0.50343 -0.01152 | ||
- | |||
- | Random effects: | ||
- | | ||
- | | ||
- | | ||
- | Number of obs: 308, groups: | ||
- | |||
- | Fixed effects: | ||
- | | ||
- | (Intercept) | ||
- | SUVR -0.010973 | ||
- | |||
- | Correlation of Fixed Effects: | ||
- | | ||
- | SUVR -0.986 | ||
- | |||
- | > anova(model.b, | ||
- | refitting model(s) with ML (instead of REML) | ||
- | Data: idata | ||
- | Models: | ||
- | model.a: Custom_FA ~ SUVR | ||
- | model.b: Custom_FA ~ SUVR + (1 | Subject) | ||
- | Df | ||
- | model.a | ||
- | model.b | ||
- | --- | ||
- | Signif. codes: | ||
- | </ | ||
- | |||
- | {{: | ||
- | |||
- | ==== Modelos ==== | ||
- | |||
- | === Estratificando por APOE === | ||
- | |||
- | Tenemos los genotipos de APOE en un CSV, | ||
- | <code bash> | ||
- | > head updateAPOE_FACEHBI_051218.csv | ||
- | code_facehbi; | ||
- | F079; | ||
- | F103; | ||
- | F080; | ||
- | F097; | ||
- | F018; | ||
- | F096; | ||
- | F002; | ||
- | F113; | ||
- | F027; | ||
- | </ | ||
- | Limpiamos un poco esto, | ||
- | <code bash> | ||
- | > awk -F";" | ||
- | > head facehbi_apoe.csv | ||
- | Subject, | ||
- | 001,e3e4 | ||
- | 002,e3e3 | ||
- | 003,e3e3 | ||
- | 004,e3e3 | ||
- | 005,e2e3 | ||
- | 006,e3e4 | ||
- | 007,e3e3 | ||
- | 008,e3e3 | ||
- | 009,e3e3 | ||
- | </ | ||
- | Lo separamos para estratificar, | ||
- | <code bash> | ||
- | > sed ' | ||
- | > head facehbi_apoe_strats.csv | ||
- | Subject, | ||
- | 001,2 | ||
- | 002,1 | ||
- | 003,1 | ||
- | 004,1 | ||
- | 005,0 | ||
- | 006,2 | ||
- | 007,1 | ||
- | 008,1 | ||
- | 009,1 | ||
- | </ | ||
- | |||
- | Esto lo importo en R (mas o menos), | ||
- | |||
- | <code R> | ||
- | > idatawnp <- read.csv(" | ||
- | > iapoe < | ||
- | > idatacustom <- read.csv(" | ||
- | > idatatmp < | ||
- | > idata < | ||
- | > idata_apoe0 <- idata[idata$APOE == " | ||
- | </ | ||
- | Un monton de data aqui pero nos centramos en la visita basal, | ||
- | <code R> | ||
- | > m0 <- lm(idata_apoe0$FPCustom_FA_v1 ~ idata_apoe0$Global_v1.x) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = idata_apoe0$FPCustom_FA_v1 ~ idata_apoe0$Global_v1.x) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -0.051447 -0.010969 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | idata_apoe0$Global_v1.x | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.02192 on 24 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | OK. ahi no hay nada pero esto solo era para ver si funcionaba la cosa. Vamos a organizar un poco la tabla, | ||
- | <code R> | ||
- | |||
- | > colnames(idata) | ||
- | [1] " | ||
- | [4] " | ||
- | [7] " | ||
- | [10] " | ||
- | [13] " | ||
- | [16] " | ||
- | [19] " | ||
- | [22] " | ||
- | </ | ||
- | |||
- | Con esos nombres me voy a equivocar seguro, asi que | ||
- | <code R> | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata) | ||
- | [1] " | ||
- | [7] " | ||
- | [13] " | ||
- | [19] " | ||
- | </ | ||
- | |||
- | y tambien, | ||
- | <code R> | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > colnames(idata)[colnames(idata) == " | ||
- | > drops <- c(" | ||
- | > idata[ , !(names(idata) %in% drops)] | ||
- | > okdata <- idata[ , !(names(idata) %in% drops)] | ||
- | </ | ||
- | con lo cual queda mucho mas potable esto, | ||
- | <code R> | ||
- | > colnames(okdata) | ||
- | [1] " | ||
- | [8] " | ||
- | [15] " | ||
- | </ | ||
- | |||
- | Ahora, el objetivo es estudiar las variables neurosicologicas como funcion de la FA en las redes DTI (//DMN// y // | ||
- | |||
- | <code bash> | ||
- | > awk -F";" | ||
- | > scp -P 20022 edad.csv detritus.fundacioace.org: | ||
- | edad.csv | ||
- | </ | ||
- | |||
- | Vale,la meto | ||
- | |||
- | <code R> | ||
- | > edad_dlc < | ||
- | > okdata <- merge(okdata, | ||
- | > colnames(okdata) | ||
- | [1] " | ||
- | [8] " | ||
- | [15] " | ||
- | </ | ||
- | |||
- | Ahora si. Pero sigue siendo una puñeta. Mejor me hago un script que corra a traves de los modelos ;-). Venga, primero a lo bruto, //just in case//, | ||
- | |||
- | <code R> | ||
- | library(QuantPsyc) | ||
- | x< | ||
- | Color=c(" | ||
- | scan(" | ||
- | scan(" | ||
- | sink(file = " | ||
- | |||
- | for(i in 1: | ||
- | for(j in 1: | ||
- | y.data <- x[c(ni[j], np[i], " | ||
- | y.data <- y.data[complete.cases(y.data), | ||
- | a <- lm( paste (' | ||
- | writeLines(paste(" | ||
- | writeLines(paste(" | ||
- | beta <- lm.beta(a) | ||
- | for(k in 1: | ||
- | writeLines(paste(names(beta[k]), | ||
- | } | ||
- | writeLines(paste(" | ||
- | } | ||
- | } | ||
- | sink() | ||
- | </ | ||
- | |||
- | a ver, | ||
- | |||
- | <code R> | ||
- | > write.csv(okdata, | ||
- | > source(" | ||
- | Read 11 items | ||
- | Read 2 items | ||
- | </ | ||
- | Un vistazo a la salida, y effectivamente, | ||
- | < | ||
- | NP: NP NI: FPCustom | ||
- | R2: 0.245411609394026 | ||
- | </ | ||
- | Puaf. Vamos a estratificar aver, | ||
- | |||
- | < | ||
- | > write.csv(okdata0, | ||
- | > source(" | ||
- | Read 11 items | ||
- | Read 2 items | ||
- | </ | ||
- | |||
- | Poca cosa aqui, | ||
- | < | ||
- | NP: NP NI: DMN | ||
- | R2: 0.283699960037635 | ||
- | NP: FName NI: DMN | ||
- | R2: 0.260050114900356 | ||
- | </ | ||
- | |||
- | Seguimos, | ||
- | < | ||
- | > write.csv(okdata1, | ||
- | > source(" | ||
- | Read 11 items | ||
- | Read 2 items | ||
- | </ | ||
- | Nop. | ||
- | < | ||
- | > write.csv(okdata2, | ||
- | > source(" | ||
- | Read 11 items | ||
- | Read 2 items | ||
- | </ | ||
- | grrrrrrr... | ||
- | < | ||
- | NP: LL_Naming | ||
- | R2: 0.338308455461783 | ||
- | NP: NP NI: FPCustom | ||
- | R2: 0.423468586516873 | ||
- | NP: KD_p NI: FPCustom | ||
- | R2: 0.300292939478652 | ||
- | NP: KD_i NI: FPCustom | ||
- | R2: 0.3278128869582 | ||
- | NP: FName NI: FPCustom | ||
- | R2: 0.377022589868983 | ||
- | NP: Boston | ||
- | R2: 0.305029202245965 | ||
- | NP: Boston_Libre | ||
- | R2: 0.349670089711 | ||
- | </ | ||
- | Odio estas cosas, todo porqueria que hay que mirar. | ||
- | <code R> | ||
- | > m0 <- lm(okdata2$LL_Naming ~ okdata2$DMN + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR +okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$LL_Naming ~ okdata2$DMN + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -1.0747 -0.2115 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.3551 on 32 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$LL_Naming ~ okdata2$DMN + okdata2$Escolaridad + okdata2$Edad) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$LL_Naming ~ okdata2$DMN + okdata2$Escolaridad + | ||
- | okdata2$Edad) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.13733 -0.21729 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.3469 on 34 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | Baaaah, pero he escrito papers con menos. Esta es la variable que se llama en la tabla **LLNaming_total_NP**, | ||
- | |||
- | Seguimos, la segunda asociacion no dice nada, | ||
- | < | ||
- | > m0 <- lm(okdata2$NP ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$NP ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -26.514 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 12.25 on 32 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$NP ~ okdata2$Escolaridad + okdata2$Edad) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$NP ~ okdata2$Escolaridad + okdata2$Edad) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -27.939 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 12.41 on 35 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | la variable NP esta asociada casi exclusivamente, | ||
- | < | ||
- | > m0 <- lm(okdata2$KD_p ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$KD_p ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -4.0610 -0.7722 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 1.562 on 16 degrees of freedom | ||
- | (16 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$KD_i ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$KD_i ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -4.9060 -0.8693 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 2.539 on 17 degrees of freedom | ||
- | (15 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$FName ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$FName ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -44.333 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 15.39 on 32 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$Boston ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$Boston ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -15.5752 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 4.386 on 31 degrees of freedom | ||
- | (1 observation deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | > m0 <- lm(okdata2$Boston_Libre ~ okdata2$FPCustom + okdata2$Escolaridad + okdata2$Edad+ okdata2$SUVR + okdata2$male) | ||
- | > summary(m0) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$Boston_Libre ~ okdata2$FPCustom + okdata2$Escolaridad + | ||
- | okdata2$Edad + okdata2$SUVR + okdata2$male) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -9.6225 -1.9833 -0.2538 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Escolaridad | ||
- | okdata2$Edad | ||
- | okdata2$SUVR | ||
- | okdata2$male | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 3.558 on 32 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | **Resumiendo, | ||
- | |||
- | ====Cosas raras==== | ||
- | |||
- | Si hacemos un modelo con todo observamos una cosa curiosa, | ||
- | |||
- | < | ||
- | > m1 <- lm(okdata$LL_Naming ~ okdata$FPCustom + okdata$SUVR + okdata$Escolaridad + okdata$male +okdata$Edad + okdata$APOE) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata$LL_Naming ~ okdata$FPCustom + okdata$SUVR + | ||
- | okdata$Escolaridad + okdata$male + okdata$Edad + okdata$APOE) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.75246 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata$FPCustom | ||
- | okdata$SUVR | ||
- | okdata$Escolaridad | ||
- | okdata$male | ||
- | okdata$Edad | ||
- | okdata$APOE | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.3216 on 147 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | |||
- | </ | ||
- | El modelo es una porqueria pero los residuales indican que hay un estratificacion para la variable // | ||
- | | {{: | ||
- | | {{: | ||
- | |||
- | Y tal y como indica el ajuste, | ||
- | < | ||
- | > m1 <- lm(okdata$LL_Naming ~ okdata$FPCustom) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata$LL_Naming ~ okdata$FPCustom) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.88482 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata$FPCustom | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.3248 on 152 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | | {{: | ||
- | | {{: | ||
- | |||
- | **Nota:** Estas variables estan muy sesgadas por los valores dados en la clinica, de ahi este comportamiento raro. | ||
- | ===== Composites ===== | ||
- | |||
- | Vamos a intentar el procedimiento utilizando los composites de //NP//. Las variables de los composites son, | ||
- | < | ||
- | funcioExecutiva_fluencia | ||
- | funcioExecutiva_velocprocess_IM | ||
- | funcioExecutiva_atencio | ||
- | memoria_fnameProf | ||
- | memoria_fnameNom | ||
- | memoria_wms | ||
- | memoria_rbans | ||
- | gnosia | ||
- | praxia | ||
- | </ | ||
- | |||
- | Saco las variables que necesito, | ||
- | <code bash> | ||
- | > awk -F";" | ||
- | > awk -F";" | ||
- | > sed ' | ||
- | > scp -P 20022 facehbi_apoe_strats.csv detritus.fundacioace.org: | ||
- | facehbi_apoe_strats.csv | ||
- | > scp -P 20022 facehbi_data.csv detritus.fundacioace.org: | ||
- | ............ | ||
- | facehbi_[osotolongo@detritus dti_model]$ awk -F";" | ||
- | data.csv | ||
- | |||
- | </ | ||
- | |||
- | La importo en R, | ||
- | <code R> | ||
- | > fdata < | ||
- | > fapoe < | ||
- | > fdti <- read.csv(" | ||
- | > okdata <- merge(fdata, | ||
- | > okdata <- merge(okdata, | ||
- | </ | ||
- | preparo la lista de variables, | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ cat npvars.names | ||
- | funcioExecutiva_fluencia | ||
- | funcioExecutiva_velocprocess_IM | ||
- | funcioExecutiva_atencio | ||
- | memoria_fnameProf | ||
- | memoria_fnameNom | ||
- | memoria_wms | ||
- | memoria_rbans | ||
- | gnosia | ||
- | praxia | ||
- | [osotolongo@detritus dti_model]$ cat nivars.names | ||
- | DMN | ||
- | FPCustom | ||
- | </ | ||
- | |||
- | y hacemos la primera prueba, | ||
- | <code R> | ||
- | > write.csv(okdata, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 2 items | ||
- | </ | ||
- | |||
- | No muy bien hasta ahora, | ||
- | < | ||
- | NP: funcioExecutiva_velocprocess_IM | ||
- | R2: 0.315511475678145 | ||
- | </ | ||
- | |||
- | Estratificamos ahora, | ||
- | |||
- | <code R> | ||
- | > okdata0 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata0, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 2 items | ||
- | > okdata1 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata1, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 2 items | ||
- | > okdata2 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata2, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 2 items | ||
- | </ | ||
- | |||
- | Pero sigue el mismo estilo | ||
- | |||
- | //APOE 0// | ||
- | < | ||
- | NP: funcioExecutiva_fluencia | ||
- | R2: 0.243867525131838 | ||
- | NP: memoria_fnameNom | ||
- | R2: 0.390194941103106 | ||
- | NP: memoria_wms | ||
- | R2: 0.346181066305969 | ||
- | </ | ||
- | //APOE 1// | ||
- | < | ||
- | NP: funcioExecutiva_velocprocess_IM | ||
- | R2: 0.312707319581829 | ||
- | </ | ||
- | //APOE 2// | ||
- | < | ||
- | NP: funcioExecutiva_velocprocess_IM | ||
- | R2: 0.438816661720517 | ||
- | NP: memoria_fnameNom | ||
- | R2: 0.360648103744986 | ||
- | NP: llenguatge_denom_IM | ||
- | R2: 0.301108942185496 | ||
- | </ | ||
- | |||
- | y eso es lo mejorcito. Vamos a mirar un poco mejor los //APOE 2// (N=38) :-/, que tienen la mejor asociacion. | ||
- | <code R> | ||
- | > m1 <- lm(okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + okdata2$Edad + okdata2$Escolaridad + okdata2$female + okdata2$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + | ||
- | okdata2$Edad + okdata2$Escolaridad + okdata2$female + okdata2$SUVR) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.56334 -0.50510 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$Edad | ||
- | okdata2$Escolaridad | ||
- | okdata2$female | ||
- | okdata2$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.7156 on 32 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | Voy a limpiar un poco a ver, | ||
- | <code R> | ||
- | > m1 <- lm(okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + okdata2$female + okdata2$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + | ||
- | okdata2$female + okdata2$SUVR) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.72431 -0.45826 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$female | ||
- | okdata2$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.7159 on 34 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | un poco mas, | ||
- | |||
- | <code R> | ||
- | > m1 <- lm(okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + okdata2$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + | ||
- | okdata2$SUVR) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.60347 -0.37573 -0.05682 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.7333 on 35 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | Vaya, no esta tan mal. | ||
- | |||
- | A ver si encajo esto de alguna manera, | ||
- | |||
- | //APOE 0// | ||
- | < | ||
- | > m1 <- lm(okdata0$funcioExecutiva_velocprocess_IM ~ okdata0$DMN + okdata0$Escolaridad + okdata0$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata0$funcioExecutiva_velocprocess_IM ~ okdata0$DMN + | ||
- | okdata0$Escolaridad + okdata0$SUVR) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -0.88656 -0.46872 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata0$DMN | ||
- | okdata0$Escolaridad -0.11401 | ||
- | okdata0$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.6454 on 22 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | //APOE 1// | ||
- | < | ||
- | > m1 <- lm(okdata1$funcioExecutiva_velocprocess_IM ~ okdata1$DMN + okdata1$Escolaridad + okdata1$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata1$funcioExecutiva_velocprocess_IM ~ okdata1$DMN + | ||
- | okdata1$Escolaridad + okdata1$SUVR) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -1.3510 -0.6597 -0.1832 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | okdata1$DMN | ||
- | okdata1$Escolaridad | ||
- | okdata1$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.9785 on 86 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | //APOE 2// | ||
- | < | ||
- | > m1 <- lm(okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + okdata2$Escolaridad + okdata2$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$funcioExecutiva_velocprocess_IM ~ okdata2$DMN + | ||
- | okdata2$Escolaridad + okdata2$SUVR) | ||
- | |||
- | Residuals: | ||
- | | ||
- | -1.62197 -0.38893 -0.06813 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata2$DMN | ||
- | okdata2$Escolaridad | ||
- | okdata2$SUVR | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.7369 on 34 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | |||
- | **Hasta ahora:** En los sujetos con el alelo $\epsilon$-4 presente, la variable // | ||
- | ==== Variables de MB ==== | ||
- | Hay un interes especial en las variables de los tesst " | ||
- | <code bash> | ||
- | > awk -F";" | ||
- | > scp -P 20022 facehbi_data_mb.csv detritus.fundacioace.org: | ||
- | facehbi_data_mb.csv | ||
- | </ | ||
- | Los cargo, hago un composite con estas variables y miro los modelos. | ||
- | < | ||
- | > fdata < | ||
- | > fapoe < | ||
- | > fdti <- read.csv(" | ||
- | > okdata <- merge(fdata, | ||
- | > okdata <- merge(okdata, | ||
- | > okdata$zPPp = (okdata$PPp - mean(okdata$PPp, | ||
- | > okdata$zPPi = (okdata$PPi - mean(okdata$PPi, | ||
- | > okdata$zKDi = (okdata$KDi - mean(okdata$KDi, | ||
- | > okdata$zKDp = (okdata$KDp - mean(okdata$KDp, | ||
- | > np <- data.frame(okdata$zPPp, | ||
- | > fanp <- fa(np) | ||
- | > okdata$scop <- fanp$scores | ||
- | > m1 <- lm(okdata$scop ~ okdata$DMN + okdata$Edad + okdata$Escolaridad + okdata$female + okdata$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata$scop ~ okdata$DMN + okdata$Edad + okdata$Escolaridad + | ||
- | okdata$female + okdata$SUVR) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -3.7621 -0.2453 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata$DMN | ||
- | okdata$Edad | ||
- | okdata$Escolaridad | ||
- | okdata$female | ||
- | okdata$SUVR | ||
- | |||
- | Residual standard error: 0.8891 on 68 degrees of freedom | ||
- | (80 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | > m1 <- lm(okdata$scop ~ okdata$FPCustom + okdata$Edad + okdata$Escolaridad + okdata$female + okdata$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata$scop ~ okdata$FPCustom + okdata$Edad + okdata$Escolaridad + | ||
- | okdata$female + okdata$SUVR) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -3.8339 -0.2617 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata$FPCustom | ||
- | okdata$Edad | ||
- | okdata$Escolaridad | ||
- | okdata$female | ||
- | okdata$SUVR | ||
- | |||
- | Residual standard error: 0.8903 on 68 degrees of freedom | ||
- | (80 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | > okdata0 <- okdata[okdata$APOE == " | ||
- | > m1 <- lm(okdata0$scop ~ okdata0$FPCustom + okdata0$Edad + okdata0$Escolaridad + okdata0$female + okdata0$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata0$scop ~ okdata0$FPCustom + okdata0$Edad + | ||
- | okdata0$Escolaridad + okdata0$female + okdata0$SUVR) | ||
- | |||
- | Residuals: | ||
- | 19 | ||
- | | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata0$FPCustom | ||
- | okdata0$Edad | ||
- | okdata0$Escolaridad | ||
- | okdata0$female | ||
- | okdata0$SUVR | ||
- | |||
- | Residual standard error: 1.142 on 2 degrees of freedom | ||
- | (18 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | > okdata1 <- okdata[okdata$APOE == " | ||
- | > m1 <- lm(okdata1$scop ~ okdata1$FPCustom + okdata1$Edad + okdata1$Escolaridad + okdata1$female + okdata1$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata1$scop ~ okdata1$FPCustom + okdata1$Edad + | ||
- | okdata1$Escolaridad + okdata1$female + okdata1$SUVR) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -1.7087 -0.3229 | ||
- | |||
- | Coefficients: | ||
- | | ||
- | (Intercept) | ||
- | okdata1$FPCustom | ||
- | okdata1$Edad | ||
- | okdata1$Escolaridad | ||
- | okdata1$female | ||
- | okdata1$SUVR | ||
- | |||
- | Residual standard error: 0.6507 on 38 degrees of freedom | ||
- | (46 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | > okdata2 <- okdata[okdata$APOE == " | ||
- | > m1 <- lm(okdata2$scop ~ okdata2$FPCustom + okdata2$Edad + okdata2$Escolaridad + okdata2$female + okdata2$SUVR) | ||
- | > summary(m1) | ||
- | |||
- | Call: | ||
- | lm(formula = okdata2$scop ~ okdata2$FPCustom + okdata2$Edad + | ||
- | okdata2$Escolaridad + okdata2$female + okdata2$SUVR) | ||
- | |||
- | Residuals: | ||
- | Min 1Q Median | ||
- | -3.6076 -0.3908 | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(>|t|) | ||
- | (Intercept) | ||
- | okdata2$FPCustom | ||
- | okdata2$Edad | ||
- | okdata2$Escolaridad | ||
- | okdata2$female | ||
- | okdata2$SUVR | ||
- | |||
- | Residual standard error: 1.285 on 16 degrees of freedom | ||
- | (16 observations deleted due to missingness) | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | </ | ||
- | Con lo cual me convenzo de que esto no vale para nada. | ||
- | |||
- | ===== Todas las redes ===== | ||
- | |||
- | No creo que funcione pero por completitud debo hacer el mismo procedimiento para todas las redes que hemos medido, esto es: DMN, FPCustom, LN y SN. | ||
- | |||
- | <code bash> | ||
- | [osotolongo@detritus facehbi]$ awk -F";" | ||
- | [osotolongo@detritus facehbi]$ awk -F";" | ||
- | [osotolongo@detritus facehbi]$ awk -F";" | ||
- | [osotolongo@detritus facehbi]$ awk -F";" | ||
- | [osotolongo@detritus facehbi]$ join -t";" | ||
- | [osotolongo@detritus facehbi]$ head facehbi_fa.csv | ||
- | Subject; | ||
- | 001;;;; | ||
- | 002;;;; | ||
- | 003;;;; | ||
- | 004; | ||
- | 005; | ||
- | 006; | ||
- | 007; | ||
- | 008; | ||
- | 009; | ||
- | [osotolongo@detritus facehbi]$ cp facehbi_fa.csv ~/ | ||
- | </ | ||
- | |||
- | voy a cambiar el script de R para que me de algo mas de info, | ||
- | |||
- | <code R> | ||
- | library(QuantPsyc) | ||
- | x< | ||
- | Color=c(" | ||
- | scan(" | ||
- | scan(" | ||
- | sink(file = " | ||
- | |||
- | for(i in 1: | ||
- | for(j in 1: | ||
- | y.data <- x[c(ni[j], np[i], " | ||
- | y.data <- y.data[complete.cases(y.data), | ||
- | a <- lm( paste (' | ||
- | writeLines(paste(" | ||
- | writeLines(paste(" | ||
- | writeLines(paste(" | ||
- | beta <- lm.beta(a) | ||
- | for(k in 1: | ||
- | writeLines(paste(names(beta[k]), | ||
- | } | ||
- | writeLines(paste(" | ||
- | } | ||
- | } | ||
- | sink() | ||
- | </ | ||
- | y a probar con los composites de nuevo, | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ cat nivars.names | ||
- | DMN_FA | ||
- | LN_FA | ||
- | SN_FA | ||
- | FPCustom_FA | ||
- | [osotolongo@detritus dti_model]$ cat npvars.names | ||
- | funcioExecutiva_fluencia | ||
- | funcioExecutiva_velocprocess_IM | ||
- | funcioExecutiva_atencio | ||
- | memoria_fnameProf | ||
- | memoria_fnameNom | ||
- | memoria_wms | ||
- | memoria_rbans | ||
- | gnosia | ||
- | praxia | ||
- | llenguatge_denom_IM | ||
- | </ | ||
- | Empiezo con el global, | ||
- | <code R> | ||
- | > fdti <- read.csv(" | ||
- | > fdata < | ||
- | > fapoe < | ||
- | > okdata <- merge(fdata, | ||
- | > okdata <- merge(okdata, | ||
- | > write.csv(okdata, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 4 items | ||
- | </ | ||
- | movemos los resultados, | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ mv facehbi_dti_np_models.txt facehbi_dti_np_models_all.txt | ||
- | </ | ||
- | y ahora a estratificar, | ||
- | <code R> | ||
- | > okdata0 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata0, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 4 items | ||
- | </ | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ mv facehbi_dti_np_models.txt facehbi_dti_np_models_0.txt | ||
- | </ | ||
- | <code R> | ||
- | > okdata1 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata1, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 4 items | ||
- | </ | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ mv facehbi_dti_np_models.txt facehbi_dti_np_models_1.txt | ||
- | </ | ||
- | <code R> | ||
- | > okdata2 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata2, | ||
- | > source(" | ||
- | Read 10 items | ||
- | Read 4 items | ||
- | </ | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ mv facehbi_dti_np_models.txt facehbi_dti_np_models_2.txt | ||
- | </ | ||
- | y lo voy a guardar, por si acaso, | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ tar czvf facehbi_dti_np_models.tgz facehbi_dti_np_models_* | ||
- | facehbi_dti_np_models_0.txt | ||
- | facehbi_dti_np_models_1.txt | ||
- | facehbi_dti_np_models_2.txt | ||
- | facehbi_dti_np_models_all.txt | ||
- | </ | ||
- | |||
- | **Nota:** Estos hay que revisarlos despacio pues puede haber alguna asosiacion con el SUVR que hayamos pasado por alto. | ||
- | |||
- | Ahora el otro composite, | ||
- | <code R> | ||
- | > fdata < | ||
- | > okdata <- merge(okdata, | ||
- | > okdata$zPPp = (okdata$PPp - mean(okdata$PPp, | ||
- | > okdata$zPPi = (okdata$PPi - mean(okdata$PPi, | ||
- | > okdata$zKDi = (okdata$KDi - mean(okdata$KDi, | ||
- | > okdata$zKDp = (okdata$KDp - mean(okdata$KDp, | ||
- | > mb <- data.frame(okdata$zPPp, | ||
- | > okdata$cs <- mbsc$scores | ||
- | </ | ||
- | <code bash> | ||
- | [osotolongo@detritus dti_model]$ cat npvars.names | ||
- | cs | ||
- | </ | ||
- | <code R> | ||
- | > write.csv(okdata, | ||
- | > source(" | ||
- | Read 1 item | ||
- | Read 4 items | ||
- | </ | ||
- | y lo hago estratificado tambien, (moviendo los outputs como antes) | ||
- | <code R> | ||
- | > okdata0 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata0, | ||
- | > source(" | ||
- | Read 1 item | ||
- | Read 4 items | ||
- | > okdata1 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata1, | ||
- | > source(" | ||
- | Read 1 item | ||
- | Read 4 items | ||
- | > okdata2 <- okdata[okdata$APOE == " | ||
- | > write.csv(okdata2, | ||
- | > source(" | ||
- | Read 1 item | ||
- | Read 4 items | ||
- | </ | ||
- | y aqui si no hay nada de nada. | ||
- | Voy a hacerme un script para sacar cuando R2 es mayor que //0.3// por poner un numero, | ||
- | <code perl checkr2.pl> | ||
- | # | ||
- | |||
- | use strict; | ||
- | use warnings; | ||
- | use Data::Dump qw(dump); | ||
- | |||
- | my $ifile = " | ||
- | my $thresh = 0.3; | ||
- | my %model; | ||
- | open IDF, "< | ||
- | while (< | ||
- | if (/-------/ && $model{" | ||
- | print $model{" | ||
- | }; | ||
- | if (/^NP:.*/) {($model{" | ||
- | if (/^R2:.*/) {($model{" | ||
- | if (/ | ||
- | } | ||
- | close IDF; | ||
- | </ | ||
- | |||
- | Para todos, | ||
- | |||
- | < | ||
- | [osotolongo@detritus dti_model]$ ./ | ||
- | Analizing facehbi_dti_np_models_all.txt ... | ||
- | DMN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.302226155665606, | ||
- | pv_DMN_FA = 0.883576950793585, | ||
- | LN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.302579788141454, | ||
- | pv_LN_FA = 0.731754149108559, | ||
- | SN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.302699583800708, | ||
- | pv_SN_FA = 0.698477685239432, | ||
- | FPCustom_FA, | ||
- | r2 = 0.303857285316447, | ||
- | pv_FPCustom_FA = 0.495322950618766, | ||
- | </ | ||
- | |||
- | //APOE 0// | ||
- | |||
- | < | ||
- | [osotolongo@detritus dti_model]$ ./ | ||
- | Analizing facehbi_dti_np_models_0.txt ... | ||
- | DMN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.379552223636583, | ||
- | pv_DMN_FA = 0.639790744923555, | ||
- | LN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.373746758451691, | ||
- | pv_LN_FA = 0.922726301726418, | ||
- | SN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.373504904382816, | ||
- | pv_SN_FA = 0.978604565669928, | ||
- | FPCustom_FA, | ||
- | r2 = 0.376679557258316, | ||
- | pv_FPCustom_FA = 0.734462972707933, | ||
- | DMN_FA, memoria_wms | ||
- | r2 = 0.384900678414176, | ||
- | pv_DMN_FA = 0.971755525011924, | ||
- | LN_FA, memoria_wms | ||
- | r2 = 0.476189288707085, | ||
- | pv_LN_FA = 0.0571602758952463, | ||
- | SN_FA, memoria_wms | ||
- | r2 = 0.4105573407532, | ||
- | pv_SN_FA = 0.327134537994976, | ||
- | FPCustom_FA, | ||
- | r2 = 0.38938771125582, | ||
- | pv_FPCustom_FA = 0.683663237630694, | ||
- | </ | ||
- | |||
- | //APOE 1// --> **nada** | ||
- | |||
- | //APOE 2// | ||
- | |||
- | < | ||
- | [osotolongo@detritus dti_model]$ ./ | ||
- | Analizing facehbi_dti_np_models_2.txt ... | ||
- | DMN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.485798156550142, | ||
- | pv_DMN_FA = 0.00443564461139048, | ||
- | LN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.391142446695136, | ||
- | pv_LN_FA = 0.298247246087403, | ||
- | SN_FA, funcioExecutiva_velocprocess_IM | ||
- | r2 = 0.473679765360014, | ||
- | pv_SN_FA = 0.0075840881661726, | ||
- | FPCustom_FA, | ||
- | r2 = 0.420481875101633, | ||
- | pv_FPCustom_FA = 0.0767718841930776, | ||
- | DMN_FA, memoria_fnameProf | ||
- | r2 = 0.327588088792215, | ||
- | pv_DMN_FA = 0.773974302319369, | ||
- | LN_FA, memoria_fnameProf | ||
- | r2 = 0.382914152316493, | ||
- | pv_LN_FA = 0.0561917139565343, | ||
- | SN_FA, memoria_fnameProf | ||
- | r2 = 0.327676768593875, | ||
- | pv_SN_FA = 0.76680425794751, | ||
- | FPCustom_FA, | ||
- | r2 = 0.331099185559454, | ||
- | pv_FPCustom_FA = 0.584035234528739, | ||
- | DMN_FA, memoria_fnameNom | ||
- | r2 = 0.328367049483929, | ||
- | pv_DMN_FA = 0.898296424312723, | ||
- | LN_FA, memoria_fnameNom | ||
- | r2 = 0.330867944990235, | ||
- | pv_LN_FA = 0.679077371093828, | ||
- | SN_FA, memoria_fnameNom | ||
- | r2 = 0.331778400581458, | ||
- | pv_SN_FA = 0.633252108652689, | ||
- | FPCustom_FA, | ||
- | r2 = 0.334618953643581, | ||
- | pv_FPCustom_FA = 0.524784142484717, | ||
- | DMN_FA, memoria_wms | ||
- | r2 = 0.30272247894919, | ||
- | pv_DMN_FA = 0.228059068988977, | ||
- | </ | ||