Microsoft Word Document
Here is the Microsoft Word document for this web page.
- Create a directory called “C:\PCI2_SAS_Macro”
- Copy file “sasmacr.sas7bcat” to “C:\PCI2_SAS_Macro”
- Create a directory called “C:\PCI”
- Copy file “PCI2_Run_SAS_Macro.sas” to “C:\PCI”
- Start SAS and Create SAS libraries
The PCI2 data and macro need be accessed from SAS “libraries”. To create a library in SAS:
- “Right click” on the “Libraries” icon in the left window (Figure 1)
- Select “New”
- In the “New Library” dialog box:
- type PCI in the “Name” box,
- Check the box “Enable at startup”
- Type C:\PCI In the “Path” box (alternatively, use the Browse button to find the directory)Figure 1. Creating libraries in SAS.
Repeat this process for the library and file location of the PCI2_SAS_Macro (Figure 2). When finished, your “Active Libraries” Explorer Window should include the two new libraries that were created (Figure 3).
Figure 2. Creating a library for the PCI macro.Figure 3. Active libraries in SAS
Running PCI in SAS
In the C:\PCI directory, double click on the file “PCI2_Run_SAS_Macro.sas”.
This file contains 3 lines of code:
options mstored sasmstore=pci2_sas;
libname storemac ‘C:\PCI2_SAS_Macro’;
Highlight these lines of code and click the “Submit” button From this point forward, PCI2 is menu driven. The first form will look like Figure 4.
- As noted on the initial form, the Run Description is a data set name for SAS. The PCI2 results from one or more analyses during a session will be stored in this data set. The name of this data set must follow SAS naming conventions (see Figure 4) and cannot exceed 20 characters.
- You can control the number of repetitions for the PCI simulation. If no number is entered, the default is 1,000 repetitions. The standard deviations generated from these simulations can be used to statistically test for differences between two or more “observed” PCI values. Other statistics (e.g., skewness, kurtosis) generated by the simulation provide an indication of whether the PCI is normally distributed.
- If you have placed the “PCI2_Run_SAS_Macro.sas” file in “C:\PCI”, the directory name for the third field will always be C:\PCI.
Figure 4. Initial PCI input form.
Once the requested information has been entered:
- put the cursor in the blue box (Figure 4)
- press C (or c)
- and then press the ENTER key.
Figure 5 illustrates the “Data Entry” form (i.e., the second form in the PCI2 for SAS menu system).
- Use the TAB key to advance between fields on this form.
- The “Describe this analysis” field allows for multiple PCI analyses during a single SAS session. If your “Run Description” in Figure 4 was “Test”, you might want to call your first analysis “Test 1”, the second “Test 2″, etc. (spaces are allowed in the Describe this analysis” field). These different analyses could be different distributions or evaluations of using different power functions on the same distribution (see Vaske, Beaman, Barreto, & Shelby, 2010) for an explanation of power).
- PCI2 allows for 3 distance functions. The choice of distance function used partially depends on the type of scale being analyzed (e.g., bipolar vs. unipolar) and whether you want to include neutral values in the calculation of PCI. D1 excludes neutral responses; D2 includes neutral values. We currently recommend D1 for “Bipolar scales with a neutral value”. D3should be used with unipolar scales
- For D1 – Bipolar scales with a neutral value, the values of a variable can be coded negative ( – ) to positive ( + ) or be all positive (e.g., 1, 2, 3, 4, 5, 6).
- For D2 – Bipolar scales without a neutral value, the values for a variable must be coded negative ( – ) to positive ( + ).
- Power must be 1, 2, 3, or 4. We currently recommend a power of 1, but encourage experimentation with other power functions.
- The “total responses” refers to your sample size.
- See Figure 6 for an illustration of “scale values” and “lowest scale value”.
Figure 5. The PCI2 data entry form.
Once the requested information has been entered, put the cursor in the blue box (Figure 5), press C (or c), and then the ENTER key.
Figure 6 is an illustration of a completed data entry form. In this example, the researcher described this analysis as “Test 1”. D1 was selected as the distance function, in part because a bipolar scale with a neutral value was being analyzed. The power function was set to 1. The sample size for this analysis was 400. A 7-point scale (e.g., strongly disagree to strongly agree) was analyzed and the variable was coded negative to positive (i.e., -3, -2, -1, 0, 1, 2, 3).
Figure 6. Illustration of completed data entry form.
Given the information in Figure 6, the SAS menu system generated the “Frequencies Input Form” (Figure 7). Notice that you do not have to type the scale values. The program produced these values based on the input given in Figure 6.
The observed frequencies are entered into the appropriate fields. Zeros should be entered if no one responded to a given scale value. Because the scale width was 7, entries into the 8th and 9th values are not allowed.
Once the observed frequencies have been entered (see Figure 8 as an example), put the cursor in the blue box (Figure 7 or 8), press C (or c), and then the ENTER key.
Figure 7. Frequencies input form.
Figure 8. Completed example of a Frequencies Input Form
Figure 9 � Submit for processing form � allows you to continue with this analysis, disgard the changes or finish the session. A warning is issued if the same description is used (e.g., Test 1). Pressing disgard allows you to return to early forms to make corrections. When calculating multiple PCI values in a single SAS session, the case number is automatically updated in the SAS data set.
Figure 9. Submit for processing form
The results from this analysis are shown in Figure 10. The observed and simulated (i.e., Mean) PCI2 were approximately .66 for the distribution entered in Figure 8. PCI2 values range from 0 to 1. A value of 0 indicates total consensus; a value of 1 equates to total conflict. The simulated PCI2 standard deviation can be used to calculate statistical differences between two PCI2 values (see Vaske et al., 2010). The skewness and kurtosis values suggest that the simulated distribution was approximately normally distribution.
Figure 10. Observed and simulated PCI results
The results from this analysis were written to a SAS data set called “test.sas7bdat” and were exported to an Excel file. The default Excel filename is “xlspci.xls”. If you want to save these results for future use, change this filename to another name prior to your next PCI2 in SAS session.
If you experience difficulties in setting up or running PCI2 in SAS, please contact us. We are interested in your comments, suggestions, or criticisms of the menu system.
Jerry J. Vaske
Colorado State University
Human Dimensions of Natural Resources
Fort Collins, Colorado 80523