Computer Lab For Calculating Cronbach's Alpha and Installing Mplus
Computer Lab For Calculating Cronbach's Alpha and Installing Mplus
Step 0: Create a “pubh7435” folder on the desktop where you can keep work that is done
throughout the semester.
2. Open SAS and import the genetictesting data. To import the dataset
“genetictestingrawdata.xls”, click on the File button then on Import Data… A
wizard pops up asking you what type of file it is, usually by default it is on
“Microsoft Excel”, if so click Next, then it will pop-up a window with a Browse
button which you can use to find the genetictestingrawdata.xls data on your
computer (remember you put it in the pubh7435 folder on your desktop). Find the
file, click on it and say Ok. Then SAS will ask you which table you want to
import (this is because there are actually 3 sheets in the .xls file, but only the first
one has any data on it), so we want Sheet1$. If you click on Options… you’ll see
what SAS is doing by default, make sure that the “Use data in the first row as
SAS variable name” has a checkmark next to it. Then say OK, and Next. The
next panel asks you to “Choose the SAS destination” and the cursor is located in
the “Member” fill-in. In the member slot is where you type in a name for the
dataset you are importing. You should give it a simple name that can be used to
call it from within SAS. I like to call my datasets very simply, e.g. “a”. But you
can call it anything, like “mygenetictestingdata”, you just can’t put blanks in the
name. This will be the name SAS uses to call the data when running procedures.
Once you’ve typed in a name, click Finish. In the log window, if all went well, it
should say “NOTE: WORK.A was successfully created.”
3. Run the “genetictesting.sas” program downloaded from the class data website.
Scroll through the results in the output Window, these are results we have seen in
class. Proc Corr with the alpha option gives us Cronbach’s alpha analysis and
Proc Factor gives us eigenvalues (along with a lot of other output we will examine
later). To run the program in the program Editor click on Run then Submit, or
simply click on the running man icon.
4. If you have time after installing the Demo version of Mplus below, try running
a similar Cronbach’s alpha analysis of the “raw data for USA q29a-q29h” data.