/* this program undertakes renewed analyses following rejected paper on syllable structure submitted in Spring 08. */ libname sli "C:\1dataLap\MASHA_SLI\"; run; PROC IMPORT OUT= sli.realnonsens1 DATAFILE= "C:\1dataLap\MASHA_SLI\SLIForStatsAll090908.xls" DBMS=EXCEL REPLACE; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN; proc contents data = sli.realnonsens1; run; proc print; var F13-F18; run; proc freq data = sli.realnonsens1; tables subject; run; proc sort data = sli.realnonsens1; by subject; run; proc print data = sli.realnonsens1; var subject corrections MLU_Match Pseudo_Rom; run; proc freq; tables mlu_match age_match type; run; proc format; value $resp '1' = 'correct' '0' = 'wrong'; run; proc print; var corrections; run; data x; set sli.realnonsens1; if subject = 1 or subject = 2 or subject = 3 or subject = 4 or subject = 5 or subject = 6 or subject = 7 then group_chr = 'SLI'; if subject = 8 or subject = 9 or subject = 10 or subject = 11 or subject = 12 or subject = 13 or subject = 14 then group_chr = 'MLU'; if subject = 15 or subject = 16 or subject = 17 or subject = 18 or subject = 19 or subject = 20 or subject = 21 then group_chr = 'Age'; syl_struct = ' '; if corrections = 'CCV_1_1' then syl_struct = 'CCV'; if corrections = 'CCV_1_2' then syl_struct = 'CCV'; if corrections = 'CCV_2_1' then syl_struct = 'CCV'; if corrections = 'CCV_2_2' then syl_struct = 'CCV'; if corrections = 'CCV_3_1' then syl_struct = 'CCV'; if corrections = 'CCV_3_2' then syl_struct = 'CCV'; if corrections = 'CCVC_1_1' then syl_struct = 'CCVC'; if corrections = 'CCVC_1_2' then syl_struct = 'CCVC'; if corrections = 'CCVC_2_1' then syl_struct = 'CCVC'; if corrections = 'CCVC_2_2' then syl_struct = 'CCVC'; if corrections = 'CCVC_3_1' then syl_struct = 'CCVC'; if corrections = 'CCVC_3_2' then syl_struct = 'CCVC'; if corrections = 'CCVC_3_3' then syl_struct = 'CCVC'; if corrections = 'CCVCC_1_1' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_1_2' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_2_1' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_2_2' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_3_1' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_3_2' then syl_struct = 'CCVCC'; if corrections = 'CCVCC_3_3' then syl_struct = 'CCVCC'; if corrections = 'CV_1_1' then syl_struct = 'CV'; if corrections = 'CV_1_2' then syl_struct = 'CV'; if corrections = 'CV_2_1' then syl_struct = 'CV'; if corrections = 'CV_2_2' then syl_struct = 'CV'; if corrections = 'CV_3_1' then syl_struct = 'CV'; if corrections = 'CV_3_2' then syl_struct = 'CV'; if corrections = 'CV_3_3' then syl_struct = 'CV'; if corrections = 'CVC_1_1' then syl_struct = 'CVC'; if corrections = 'CVC_1_2' then syl_struct = 'CVC'; if corrections = 'CVC_2_1' then syl_struct = 'CVC'; if corrections = 'CVC_2_2' then syl_struct = 'CVC'; if corrections = 'CVC_3_1' then syl_struct = 'CVC'; if corrections = 'CVC_3_2' then syl_struct = 'CVC'; if corrections = 'CVC_3_3' then syl_struct = 'CVC'; if corrections = 'CVCC_1_1' then syl_struct = 'CVCC'; if corrections = 'CVCC_1_2' then syl_struct = 'CVCC'; if corrections = 'CVCC_2_1' then syl_struct = 'CVCC'; if corrections = 'CVCC_2_2' then syl_struct = 'CVCC'; if corrections = 'CVCC_3_1' then syl_struct = 'CVCC'; if corrections = 'CVCC_3_2' then syl_struct = 'CVCC'; if corrections = 'CVCC_3_3' then syl_struct = 'CVCC'; if corrections = 'CCV_1_1' then syl_struct = 'CCV'; if corrections = 'CCV_1_2' then syl_struct = 'CCV'; if corrections = 'CCV_2_1' then syl_struct = 'CCV'; if corrections = 'CCV_2_2' then syl_struct = 'CCV'; if corrections = 'CCV_3_1' then syl_struct = 'CCV'; if corrections = 'CCV_3_2' then syl_struct = 'CCV'; if corrections = 'CCV_3_3' then syl_struct = 'CCV'; if corrections = 'VCC_1_1' then syl_struct = 'VCC'; if corrections = 'VCC_1_2' then syl_struct = 'VCC'; if corrections = 'VCC_2_1' then syl_struct = 'VCC'; if corrections = 'VCC_2_2' then syl_struct = 'VCC'; if corrections = 'VCC_3_1' then syl_struct = 'VCC'; if corrections = 'VCC_3_2' then syl_struct = 'VCC'; if corrections = 'VCC_3_3' then syl_struct = 'VCC'; if corrections = 'VC_1_1' then syl_struct = 'VC'; if corrections = 'VC_1_2' then syl_struct = 'VC'; if corrections = 'VC_2_1' then syl_struct = 'VC'; if corrections = 'VC_2_2' then syl_struct = 'VC'; if corrections = 'VC_3_1' then syl_struct = 'VC'; if corrections = 'VC_3_2' then syl_struct = 'VC'; if corrections = 'VC_3_3' then syl_struct = 'VC'; syl_no = ' '; if corrections = 'CCV_1_1' then syl_no = 'One'; if corrections = 'CCV_1_2' then syl_no = 'One'; if corrections = 'CCV_2_1' then syl_no = 'Two'; if corrections = 'CCV_2_2' then syl_no = 'Two'; if corrections = 'CCV_3_1' then syl_no = 'Three'; if corrections = 'CCV_3_2' then syl_no = 'Three'; if corrections = 'CCVC_1_1' then syl_no = 'One'; if corrections = 'CCVC_1_2' then syl_no = 'One'; if corrections = 'CCVC_2_1' then syl_no = 'Two'; if corrections = 'CCVC_2_2' then syl_no = 'Two'; if corrections = 'CCVC_3_1' then syl_no = 'Three'; if corrections = 'CCVC_3_2' then syl_no = 'Three'; if corrections = 'CCVC_3_3' then syl_no = 'Three'; if corrections = 'CCVCC_1_1' then syl_no = 'One'; if corrections = 'CCVCC_1_2' then syl_no = 'One'; if corrections = 'CCVCC_2_1' then syl_no = 'Two'; if corrections = 'CCVCC_2_2' then syl_no = 'Two'; if corrections = 'CCVCC_3_1' then syl_no = 'Three'; if corrections = 'CCVCC_3_2' then syl_no = 'Three'; if corrections = 'CCVCC_3_3' then syl_no = 'Three'; if corrections = 'CV_1_1' then syl_no = 'One'; if corrections = 'CV_1_2' then syl_no = 'One'; if corrections = 'CV_2_1' then syl_no = 'Two'; if corrections = 'CV_2_2' then syl_no = 'Two'; if corrections = 'CV_3_1' then syl_no = 'Three'; if corrections = 'CV_3_2' then syl_no = 'Three'; if corrections = 'CV_3_3' then syl_no = 'Three'; if corrections = 'CVC_1_1' then syl_no = 'One'; if corrections = 'CVC_1_2' then syl_no = 'One'; if corrections = 'CVC_2_1' then syl_no = 'Two'; if corrections = 'CVC_2_2' then syl_no = 'Two'; if corrections = 'CVC_3_1' then syl_no = 'Three'; if corrections = 'CVC_3_2' then syl_no = 'Three'; if corrections = 'CVC_3_3' then syl_no = 'Three'; if corrections = 'CVCC_1_1' then syl_no = 'One'; if corrections = 'CVCC_1_2' then syl_no = 'One'; if corrections = 'CVCC_2_1' then syl_no = 'Two'; if corrections = 'CVCC_2_2' then syl_no = 'Two'; if corrections = 'CVCC_3_1' then syl_no = 'Three'; if corrections = 'CVCC_3_2' then syl_no = 'Three'; if corrections = 'CVCC_3_3' then syl_no = 'Three'; if corrections = 'CCV_1_1' then syl_no = 'One'; if corrections = 'CCV_1_2' then syl_no = 'One'; if corrections = 'CCV_2_1' then syl_no = 'Two'; if corrections = 'CCV_2_2' then syl_no = 'Two'; if corrections = 'CCV_3_1' then syl_no = 'Three'; if corrections = 'CCV_3_2' then syl_no = 'Three'; if corrections = 'CCV_3_3' then syl_no = 'Three'; if corrections = 'VCC_1_1' then syl_no = 'One'; if corrections = 'VCC_1_2' then syl_no = 'One'; if corrections = 'VCC_2_1' then syl_no = 'Two'; if corrections = 'VCC_2_2' then syl_no = 'Two'; if corrections = 'VCC_3_1' then syl_no = 'Three'; if corrections = 'VCC_3_2' then syl_no = 'Three'; if corrections = 'VCC_3_3' then syl_no = 'Three'; if corrections = 'VC_1_1' then syl_no = 'One'; if corrections = 'VC_1_2' then syl_no = 'One'; if corrections = 'VC_2_1' then syl_no = 'Two'; if corrections = 'VC_2_2' then syl_no = 'Two'; if corrections = 'VC_3_1' then syl_no = 'Three'; if corrections = 'VC_3_2' then syl_no = 'Three'; if corrections = 'VC_3_3' then syl_no = 'Three'; Group = ' '; If type = 1 then Group = 'SLI'; If type = 2 then Group = 'MLU_match'; If type = 3 then Group = 'Age_match'; Corr_resp1 = .; If corr_resp = 0 then Corr_resp1 = 1; If corr_resp = 1 then Corr_resp1 = 0; /*numeric to character conversion example for class*/ Corr_resp_chr = put(Corr_resp1, 1.); /*character to numeric conversion example for class*/ Corr_resp2 = input(Corr_resp_chr, 8.); *if Corr_resp_chr = 1 then Corr_resp_chr = 'Correct'; *if Corr_resp_chr = 0 then Corr_resp_chr = 'Wrong'; format Corr_resp_chr $resp.; drop F13-F18; run; proc print data = x; var Corr_resp_chr corr_resp Corr_resp1 Corr_resp2; run; proc contents; run; proc means data = x; title 'Means by subject across sylno and structure'; by subject; var corr_resp1; run; proc freq data = x; tables Corr_resp_chr Group corr_resp_chr * Group/chisq; run; proc print data = x; var syl_struct syl_no corrections group; run; proc print data = x; var initial_cluster medial_cluster final_cluster; run; proc freq data = x; tables initial_cluster medial_cluster final_cluster; run; Proc freq data = x; tables Group*group_chr; run; proc print data = x; where corr_resp = .; var Subject pseudo_rom Corr_resp; run; proc sort data = x; by group_chr; run; proc means data = x; Title 'Means by Group and Syllable Number'; by group_chr; var corr_resp; *output out=means_sylno mean=Repetitions; run; proc freq data = x; title 'Number of Correct Responses by Group'; where Group_chr ne 'Age'; tables Group_chr*corr_resp /chisq; run; proc freq data = x; title 'Number of Correct Responses by Group'; where Group_chr ne 'MLU'; tables Group_chr*corr_resp /chisq; run; proc freq data = x; title 'Number of Correct Responses by Group and Subject'; tables Subject*Group_chr*corr_resp; run; Proc freq data = x; title 'Number of Correct Responses by Nonsense Word'; tables pseudo_rom*corr_resp; run; Proc freq data = x; title 'Number of Correct Responses by Group and Nonsense Word'; tables Group_chr*pseudo_rom*corr_resp; run; proc freq data = x; tables corr_resp1 syl_no; run; proc sort data = x; by GROUP syl_no syl_struct; run; /*very possibly a statistically inappropriate analysis for this binary outcome, but one that the field uses for this particular situations*/ proc glm data = x; Title 'Syl_number and structure with Group'; *where group ne ' '; class GROUP_chr syl_no syl_struct; model Corr_resp1 = GROUP_chr|syl_no|syl_struct; lsmeans GROUP_chr|syl_no|syl_struct /pdiff out=lsm; means GROUP_chr|syl_no|syl_struct ; run; quit; /*experimenting with Proc Genmod for binary outcome*/ /*RUN THE LOGISTIC REGRESSION USING PROC GENMOD*/ title "Logistic Regression Using Proc Genmod"; proc genmod data=x descending; class Group_chr Syl_no Syl_struct / param=ref; model Corr_resp1 = Group_chr syl_no syl_struct /dist=bin type3; run; PROC GENMOD DATA=x descending ; CLASS Subject Group_chr Syl_no Syl_struct ; MODEL Corr_resp1 = Group_chr Syl_no Syl_struct Group_chr*Syl_no Syl_no*Syl_struct / dist=binomial link=logit type3 ; REPEATED subject=subject / type=ar(1) CORRW; LSMEANS Group_chr / diff cl ; RUN; /*try above with logit link. */ /*some charting*/ proc chart data=x; vbar corr_resp / group=group_chr; run; ref=100 200 300 sumvar=corr_resp type=mean; run;