250 likes | 465 Views
Lab 8. Correlation with Listwise and Pairwise Deletion. Reporting Correlations in APA. r (28) = .30, p < .05 r (28) = .06, ns. Proc Corr. Produces correlation matrix for specified (continuous) variables. Produces Pearson correlations (unless you request Spearman).
E N D
Lab 8 Correlation with Listwise and Pairwise Deletion
Reporting Correlations in APA r (28) = .30, p < .05 r (28) = .06, ns
Proc Corr • Produces correlation matrix for specified (continuous) variables. • Produces Pearson correlations (unless you request Spearman). • Can perform pairwise or listwise deletion. • Provides descriptive statistics
Listwise Deletion Proc CorrNOMISS; Var var1 var2 var3; Run;
Pairwise Deletion Proc Corr; Var var1 var2 var3; Run; • Maximizes cases per comparison. • Comparisons will probably be based on slightly different cases.
Sample Size Pairwise Deletion Output
Example 4 variables: Commitment (commit): intention to remain in a relationship Satisfaction (satis): satisfaction with the relationship Investment size (invest): amount of time and personal resources that the person has put into the relationship Alternative value: attractiveness of the alternatives to the relationship
Data d1; Input @1 (commit) (2.) @4 (satis) (2.) @7 (invest) (2.) @10 (altern) (2.); Cards; 20 20 28 21 10 5 31 30 33 24 11 10 15 36 22 18 33 16 31 29 33 12 6 10 12 29 11 12 30 25 23 34 12 10 7 14 32 ; Proc corr nomiss; Var commit satis invest altern; Proc corr; Var commit satis invest altern; Run; Data and program
Descriptive Statistics with Proc Corr Listwise (nomiss) The CORR Procedure 4 Variables: commit satis invest altern Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum commit 7 20.57143 9.51940 144.00000 6.00000 31.00000 satis 7 20.00000 9.41630 140.00000 7.00000 33.00000 invest 7 25.42857 9.19886 178.00000 12.0000 34.00000 altern 7 19.00000 8.60233 133.00000 11.0000 32.00000
Listwise (nomiss) Output N = 7 Prob > |r| under H0: Rho=0 commit satis invest altern commit 1.00000 0.94826 0.81706 -0.95251 0.0011 0.0248 0.0009 satis 0.94826 1.00000 0.65998 -0.92796 0.0011 0.1067 0.0026 invest 0.81706 0.65998 1.00000 -0.84669 0.0248 0.1067 0.0162 altern -0.95251 -0.92796 -0.84669 1.00000 0.0009 0.0026 0.0162
Descriptive Statistics with Proc Corr Pairwise 4 Variables: commit satis invest altern Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum commit 9 18.33333 9.36750 165.000 6.00000 31.00000 satis 9 18.00000 9.08295 162.000 7.00000 33.00000 invest 9 22.00000 10.77033 198.000 5.00000 34.00000 altern 10 23.00000 9.64941 230.000 11.00000 36.00000
Pairwise (default) Output Prob > |r| under H0: Rho=0 Number of Observations commit satis invest altern commit 1.00000 0.95266 0.82621 -0.96011 0.0003 0.0115 <.0001 9 8 8 9 satis 0.95266 1.00000 0.71057 -0.91786 0.0003 0.0482 0.0005 8 9 8 9 invest 0.82621 0.71057 1.00000 -0.85022 0.0115 0.0482 0.0037 8 8 9 9 altern -0.96011 -0.91786 -0.85022 1.00000 <.0001 0.0005 0.0037 9 9 9 10
Correlation w/ Categorical Vars • Can separate analysis by categorical variables. Will give independent samples correlations. • Just like the BY statement in Proc GLM. Proc Corr; var Var1 Var2 Var2; by categoricalVariable; Run;
Data d1; Input @1 (commit) (2.) @4 (satis) (2.) @7 (invest) (2.) @10 (altern) (2.) @13 (gender) (1.); Cards; 20 20 28 21 1 10 5 31 1 30 33 24 11 1 10 15 36 1 22 18 33 16 1 31 29 33 12 2 6 10 12 29 2 11 12 30 2 25 23 34 12 2 10 7 14 32 2 ; Proc corr; Var commit satis invest altern; By gender; Run; Example with Gender added, 1=female, 2=male
Female (gender = 1) Descriptive Statistics --------------------------- gender=1 ----------------------------- 4 Variables: commit satis invest altern Simple Statistics Variable N Mean Std Dev Sum Mini Maxi commit 4 20.500 8.22598 82.0 10.00 30.00 satis 4 20.250 9.53502 81.0 10.00 33.00 invest 5 21.000 11.11306 105.0 5.00 33.00 alte 5 23.000 10.36822 115.00 11.00 36.00
Female (gender = 1) Correlation Output Prob > |r| under H0: Rho=0 Number of Observations commit satis invest altern commit 1.00000 0.95135 0.69889 -0.98468 0.1994 0.3011 0.0153 4 3 4 4 satis 0.95135 1.00000 0.32591 -0.87387 0.1994 0.6741 0.1261 3 4 4 4 invest 0.69889 0.32591 1.00000 -0.73770 0.3011 0.6741 0.1548 4 4 5 5 altern -0.98468 -0.87387 -0.73770 1.00000 0.0153 0.1261 0.1548 4 4 5 5
Female (gender = 1) Descriptive Statistics Variable N Mean Std Dev Sum Min Maximum commit 5 16.60000 10.78425 83.00 6.000 31.00000 satis 5 16.20000 9.36483 81.00 7.00 29.00000 invest 4 23.25000 11.87083 93.00 12.00 34.00000 altern 5 23.00000 10.09950 115.0 12.00 32.00000
Female (gender = 1) Correlation Output Number of Observations commit satis invest altern commit 1.00000 0.96888 0.96849 -0.94798 0.0066 0.0315 0.0141 5 5 4 5 satis 0.96888 1.00000 0.94622 -0.96479 0.0066 0.0538 0.0079 5 5 4 5 invest 0.96849 0.94622 1.00000 -0.98271 0.0315 0.0538 0.0173 4 4 4 4 altern -0.94798 -0.96479 -0.98271 1.00000 0.0141 0.0079 0.0173 5 5 4 5
Data d1; Input @1 (commit) (2.) @4 (satis) (2.) @7 (invest) (2.) @10 (altern) (2.); Cards; 20 20 28 21 10 5 31 30 33 24 11 10 15 36 22 18 33 16 31 29 33 12 6 10 12 29 11 12 30 25 23 34 12 10 7 14 32 ; Proc plot; Plot commit*satis commit*altern commit*invest; Run; Plotting scatterplots
Scatterplot commit*satis Plot of commit*satis. Legend: A = 1 obs, B = 2 obs, etc. (NOTE: 2 obs had missing values.) commit ‚ 30 ˆ A A ‚ A ‚ A 20 ˆ A ‚ ‚ 10 ˆ A A ‚ A ‚ 0 ˆ Šƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒ 0 10 20 30 40 satis
Scatterplot commit*altern Plot of commit*altern. Legend: A = 1 obs, B = 2 obs, etc. (NOTE: 1 obs had missing values.) commit ‚ 30 ˆ A A ‚ A ‚ A 20 ˆ A ‚ ‚ 10 ˆ A A A ‚ A ‚ 0 ˆ Šˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒ 10 15 20 25 30 35 40 altern
Scatterplot commit*altern Plot of commit*invest. Legend: A = 1 obs, B = 2 obs, etc. (NOTE: 2 obs had missing values.) commit ‚ 30 ˆ A A ‚ A ‚ A 20 ˆ A ‚ ‚ 10 ˆ A A ‚ A ‚ 0 ˆ Šƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒ 0 10 20 30 40 invest
Comparing Dependent Correlations • Use the Hotelling-William test when one variable is in common (Example in lecture notes) • Use the Steiger test when no variables are in common (Example in lecture notes)
In Class Example • Download lab8.sas from Brannick’s website. • 3 variables: • Age, “age” • Score on a knowledge test, “knwldge” • Score on an iq test, “iq” • Perform a proc corr, listwise and pairwise. • Are there significant differences in the variables and are the pairwise and listwise results different?