I created many new variables (around 40) in a dataset based on existing old variables. I plan to get the Cronbach's Alphas of all the new variables and save them to a new file. The way I am creating the variables and getting the alphas is as the following:
I would like to name/label a_x, a_w, and a_s as "Alpha X", “W's alpha”, and "The alpha of s". Then, save them to an excel file with two columns like this:
Is there a way to do so? I thought of the -matrix- command but didn't figure out how...
Code:
alpha x1 x2 x3 x4, gen(x) scalar a_x=r(alpha) //assume a_x=0.9 alpha w1 w2 w3 w4 w5 w6 w7 w8, gen(w) scalar a_w=r(alpha) //assume a_w=0.7 alpha s1 s2 s3, gen(s) scalar a_s=r(alpha) //assume a_w=0.8
Code:
Variables Alphas Alpha X 0.9 W's alpha 0.7 The alpha of s 0.8
Comment