{"id":145,"date":"2017-04-08T00:08:16","date_gmt":"2017-04-08T00:08:16","guid":{"rendered":"http:\/\/sites.warnercnr.colostate.edu\/jerryv\/?page_id=145"},"modified":"2017-04-08T00:50:06","modified_gmt":"2017-04-08T00:50:06","slug":"setting-running-pci2-sas","status":"publish","type":"page","link":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/setting-running-pci2-sas\/","title":{"rendered":"Setting up and Running PCI2 in SAS"},"content":{"rendered":"<div class=\"par-reg\">\n<h3>Microsoft Word Document<\/h3>\n<p class=\"par-reg-2\">Here is the <a href=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/word_docs\/PCI2_Instructions_for_Running_PCI_in_SAS.doc\">Microsoft Word document<\/a> for this web page.<\/p>\n<h3>Initial Setup<\/h3>\n<ul class=\"par-reg-2\">\n<li>Create a directory called &#8220;C:\\PCI2_SAS_Macro&#8221;<\/li>\n<li>Copy file &#8220;sasmacr.sas7bcat&#8221; to &#8220;C:\\PCI2_SAS_Macro&#8221;<\/li>\n<li>Create a directory called &#8220;C:\\PCI&#8221;<\/li>\n<li>Copy file &#8220;PCI2_Run_SAS_Macro.sas&#8221; to &#8220;C:\\PCI&#8221;<\/li>\n<li>Start SAS and Create SAS libraries<br \/>\nThe PCI<sub>2<\/sub> data and macro need be accessed from SAS &#8220;libraries&#8221;. To create a library in SAS:<\/p>\n<ul class=\"par-reg-2\">\n<li>&#8220;Right click&#8221; on the &#8220;Libraries&#8221; icon in the left window (Figure 1)<\/li>\n<li>Select &#8220;New&#8221;<\/li>\n<li>In the &#8220;New Library&#8221; dialog box:\n<ul class=\"par-reg-2\">\n<li>type PCI in the &#8220;Name&#8221; box,<\/li>\n<li>Check the box &#8220;Enable at startup&#8221;<\/li>\n<li>Type C:\\PCI In the &#8220;Path&#8221; box (alternatively, use the Browse button to find the directory)Figure 1. Creating libraries in SAS.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc1.gif\" alt=\"Creating libraries in SAS\" width=\"365\" height=\"199\" \/><br \/>\nRepeat this process for the library and file location of the PCI2_SAS_Macro (Figure 2). When finished, your &#8220;Active Libraries&#8221; Explorer Window should include the two new libraries that were created (Figure 3).<br \/>\nFigure 2. Creating a library for the PCI macro.Figure 3. Active libraries in SAS<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc2.gif\" alt=\"pci2 SAS macro\" width=\"306\" height=\"199\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc3.gif\" alt=\"Active Libraries&quot; Explorer Window\" width=\"195\" height=\"194\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"par-reg\">\n<h3>Running PCI in SAS<\/h3>\n<p class=\"par-reg-0\">In the C:\\PCI directory, double click on the file &#8220;PCI2_Run_SAS_Macro.sas&#8221;.<br \/>\nThis file contains 3 lines of code:<br \/>\n<span class=\"left60\">options mstored sasmstore=pci2_sas;<\/span><br \/>\n<span class=\"left60\">libname storemac &#8216;C:\\PCI2_SAS_Macro&#8217;;<\/span><br \/>\n<span class=\"left60\">%pci2_sas;<\/span><\/p>\n<p>Highlight these lines of code and click the &#8220;Submit&#8221; button <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/submit.gif\" alt=\"SAS submit button\" width=\"25\" height=\"23\" \/> From this point forward, PCI<sub>2<\/sub> is menu driven. The first form will look like Figure 4.<\/p>\n<p>Note:<\/p>\n<ul class=\"par-reg-4\">\n<li>As noted on the initial form, the Run Description is a data set name for SAS. The PCI<sub>2<\/sub> 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.<\/li>\n<li>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 &#8220;observed&#8221; PCI values. Other statistics (e.g., skewness, kurtosis) generated by the simulation provide an indication of whether the PCI is normally distributed.<\/li>\n<li>If you have placed the &#8220;PCI2_Run_SAS_Macro.sas&#8221; file in &#8220;C:\\PCI&#8221;, the directory name for the third field will always be C:\\PCI.<\/li>\n<\/ul>\n<p class=\"par-reg-0\">Figure 4. Initial PCI input form.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc4.gif\" alt=\"Initial PCI input form\" width=\"546\" height=\"196\" \/><\/p>\n<p class=\"par-reg-0\">Once the requested information has been entered:<\/p>\n<ul class=\"par-reg-4\">\n<li>put the cursor in the blue box (Figure 4)<\/li>\n<li>press C (or c)<\/li>\n<li>and then press the ENTER key.<\/li>\n<\/ul>\n<p class=\"par-reg-0\">Figure 5 illustrates the &#8220;Data Entry&#8221; form (i.e., the second form in the PCI<sub>2<\/sub> for SAS menu system).<br \/>\nNote:<\/p>\n<ul class=\"par-reg-4\">\n<li>Use the TAB key to advance between fields on this form.<\/li>\n<li>The &#8220;Describe this analysis&#8221; field allows for multiple PCI analyses during a single SAS session. If your &#8220;Run Description&#8221; in Figure 4 was &#8220;Test&#8221;, you might want to call your first analysis &#8220;Test 1&#8221;, the second &#8220;Test 2&#8243;, etc. (spaces are allowed in the Describe this analysis&#8221; field). These different analyses could be different distributions or evaluations of using different power functions on the same distribution (see Vaske, Beaman, Barreto, &amp; Shelby, 2010) for an explanation of power).<\/li>\n<li>PCI<sub>2<\/sub> 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. D<sub>1<\/sub> excludes neutral responses; D<sub>2<\/sub> includes neutral values. We currently recommend D1 for &#8220;Bipolar scales with a neutral value&#8221;. D<sub>3<\/sub>should be used with unipolar scales<\/li>\n<li>For D<sub>1<\/sub> &#8211; Bipolar scales with a neutral value, the values of a variable can be coded negative ( &#8211; ) to positive ( + ) or be all positive (e.g., 1, 2, 3, 4, 5, 6).<\/li>\n<li>For D<sub>2<\/sub> &#8211; Bipolar scales without a neutral value, the values for a variable must be coded negative ( &#8211; ) to positive ( + ).<\/li>\n<li>Power must be 1, 2, 3, or 4. We currently recommend a power of 1, but encourage experimentation with other power functions.<\/li>\n<li>The &#8220;total responses&#8221; refers to your sample size.<\/li>\n<li>See Figure 6 for an illustration of &#8220;scale values&#8221; and &#8220;lowest scale value&#8221;.<\/li>\n<\/ul>\n<p class=\"par-reg-0\">Figure 5. The PCI<sub>2<\/sub> data entry form.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc5.gif\" alt=\"Ihe PCI2 data entry form\" width=\"526\" height=\"291\" \/><br \/>\nOnce the requested information has been entered, put the cursor in the blue box (Figure 5), press C (or c), and then the ENTER key.<\/p>\n<p>Figure 6 is an illustration of a completed data entry form. In this example, the researcher described this analysis as &#8220;Test 1&#8221;. 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).<\/p>\n<p>Figure 6. Illustration of completed data entry form.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc6.gif\" alt=\"completed data entry form\" width=\"519\" height=\"384\" \/><br \/>\nGiven the information in Figure 6, the SAS menu system generated the &#8220;Frequencies Input Form&#8221; (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.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>Figure 7. Frequencies input form.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc7.gif\" alt=\"Frequencies input form\" width=\"520\" height=\"381\" \/><br \/>\nFigure 8. Completed example of a Frequencies Input Form<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc8.gif\" alt=\"Completed example of a Frequencies Input Form\" width=\"525\" height=\"384\" \/><br \/>\nFigure 9 \ufffd Submit for processing form \ufffd 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.<\/p>\n<p>Figure 9. Submit for processing form<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc9.gif\" alt=\"Submit for processing form\" width=\"429\" height=\"164\" \/><br \/>\nThe results from this analysis are shown in Figure 10. The observed and simulated (i.e., Mean) PCI<sub>2<\/sub> were approximately .66 for the distribution entered in Figure 8. PCI<sub>2<\/sub> values range from 0 to 1. A value of 0 indicates total consensus; a value of 1 equates to total conflict. The simulated PCI<sub>2<\/sub> standard deviation can be used to calculate statistical differences between two PCI<sub>2<\/sub> values (see Vaske et al., 2010). The skewness and kurtosis values suggest that the simulated distribution was approximately normally distribution.<\/p>\n<p>Figure 10. Observed and simulated PCI results<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageb\" src=\"http:\/\/warnercnr.colostate.edu\/~jerryv\/PCI2\/images\/calc10.gif\" alt=\"Observed and simulated PCI results\" width=\"502\" height=\"173\" \/><br \/>\nThe results from this analysis were written to a SAS data set called &#8220;test.sas7bdat&#8221; and were exported to an Excel file. The default Excel filename is &#8220;xlspci.xls&#8221;. If you want to save these results for future use, change this filename to another name prior to your next PCI<sub>2<\/sub> in SAS session.<\/p>\n<p>If you experience difficulties in setting up or running PCI<sub>2<\/sub> in SAS, please contact us. We are interested in your comments, suggestions, or criticisms of the menu system.<\/p>\n<p>Jerry J. Vaske<br \/>\nProfessor<br \/>\nColorado State University<br \/>\nHuman Dimensions of Natural Resources<br \/>\nFort Collins, Colorado 80523<br \/>\nPhone: 970-491-2360<br \/>\nFax: 970-491-2255<br \/>\nEmail: jerryv@cnr.colostate.edu<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Word Document Here is the Microsoft Word document for this web page. Initial Setup Create a directory called &#8220;C:\\PCI2_SAS_Macro&#8221; Copy file &#8220;sasmacr.sas7bcat&#8221; to &#8220;C:\\PCI2_SAS_Macro&#8221; Create a directory called &#8220;C:\\PCI&#8221; Copy file &#8220;PCI2_Run_SAS_Macro.sas&#8221; to &#8220;C:\\PCI&#8221; Start SAS and Create SAS&hellip; <\/p>\n","protected":false},"author":117,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-145","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/pages\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/users\/117"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":3,"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/pages\/145\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/pages\/145\/revisions\/188"}],"wp:attachment":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/jerryv\/wp-json\/wp\/v2\/media?parent=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}