I am using proc corr to calculate cronbach's alpha for a certain variable list, but the standardized alpha is coming out as a missing value. I'm not sure why this is happening, and I'm wondering if anyone has a macro to calculate Cronbach's alpha so I can go step by step and possibly figure this out. I know that if there is no variance, the standardized alpha cannot be calculated, but there is variance in the variables I am using. Does anyone have any idea what else could be the problem? Below is an image of the ODS output.
Here is the code I used and attached is some sample data:
proc corr alpha nomiss nocorr nosimple;
var cbc42 cbc65 cbc69 cbc75 cbc80 cbc88 cbc102 cbc103 cbc111 cbc51 cbc54 cbc56a
cbc56b cbc56c cbc56d cbc56e cbc56f cbc56g cbc12 cbc14 cbc31 cbc32 cbc33 cbc34
cbc35 cbc45 cbc50 cbc52 cbc71 cbc89 cbc112;
run;
Can you post your code along with some example data?
Alright I just added my code and sample data. Thanks!
You have one variable that doesn't have any variance, namely cbc51.
If you comment that variable out of your var statement you get the results you were expecting:
proc corr data=have alpha nomiss nocorr nosimple;
var cbc42 cbc65 cbc69 cbc75 cbc80 cbc88
cbc102 cbc103 cbc111 /*cbc51*/ cbc54
cbc56a cbc56b cbc56c cbc56d cbc56e
cbc56f cbc56g cbc12 cbc14 cbc31 cbc32
cbc33 cbc34 cbc35 cbc45 cbc50 cbc52
cbc71 cbc89 cbc112;
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.