<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: index score for occupations summarizing a multiple variable scores in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446673#M283275</link>
    <description>&lt;P&gt;Please supply example data in a data step with datalines and post the code you already have. Use the code posting buttons ({i} and "little running man"), do not use MS Office files.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 05:40:20 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-19T05:40:20Z</dc:date>
    <item>
      <title>index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446667#M283274</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My apologies for the vague subject line. I'm working with hundreds of occupations.&amp;nbsp;Attached is a screen shot of the data. Each occupation is scored on a number of abilities the worker needs (e.g. speech clarity). There are two scales: Importance and Level. I only care about Importance. I want to sum all the scores of Importance for specific abilities &lt;SPAN&gt;(21 of them so I won't list them here);&amp;nbsp;&lt;/SPAN&gt;each ability is assigned an Element ID but it's shared by both Importance and Level. The sum will end up as an index I will call Cognitive Index. I want to output this into a new permanent data set - let's call it CogAbilities. The new set will have 2 variables and will look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OCCSOC&amp;nbsp; &amp;nbsp; &amp;nbsp; CognitiveIndex&lt;/P&gt;
&lt;P&gt;11-1011.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&lt;/P&gt;
&lt;P&gt;11-1011.03&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 91&lt;/P&gt;
&lt;P&gt;so on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I write that program? The fact that each occupation has 105 rows of data is most challenging to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!!&lt;/P&gt;
&lt;P&gt;Diana&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 03:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446667#M283274</guid>
      <dc:creator>Diana_AdventuresinSAS</dc:creator>
      <dc:date>2018-03-19T03:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446673#M283275</link>
      <description>&lt;P&gt;Please supply example data in a data step with datalines and post the code you already have. Use the code posting buttons ({i} and "little running man"), do not use MS Office files.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 05:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446673#M283275</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-19T05:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446797#M283276</link>
      <description>&lt;P&gt;Having actual data is helpful but I would guess you are looking for something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary data=yourdataset nway;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where scalename='Importance';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class OCCSOC;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var datavalue;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; output out=want (drop=_type_ _freq_)&amp;nbsp;sum= cognitiveindex;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 14:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446797#M283276</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-19T14:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446999#M283277</link>
      <description>&lt;P&gt;Hello and thank you for your reply! I attached the&amp;nbsp;excel data&amp;nbsp;file (when I tried to attach the sas data file it said "&lt;SPAN&gt;The contents of the attachment doesn't match its file type"&amp;nbsp;I hope this works anyway).&amp;nbsp;You may notice some of the variables were deleted and/or renamed&lt;/SPAN&gt;&amp;nbsp;but everything you need is there. Your code is almost what I need &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the program I used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary data=onet.abilities nway;&lt;BR /&gt;where scalename='Importance';&lt;BR /&gt;&amp;nbsp; class OCCSOC;&lt;BR /&gt;&amp;nbsp; var score;&lt;BR /&gt; output out=cognitivedata (drop=_type_ _freq_) sum= cognitiveindex;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you notice that variable "ElementID", I specifically need the following elements to sum the cognitive abilities index:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.A.1.a.1&lt;/P&gt;
&lt;P&gt;1.A.1.a.2&lt;/P&gt;
&lt;P&gt;1.A.1.a.3&lt;/P&gt;
&lt;P&gt;1.A.1.a.4&lt;/P&gt;
&lt;P&gt;1.A.1.b.1&lt;/P&gt;
&lt;P&gt;1.A.1.b.2&lt;/P&gt;
&lt;P&gt;1.A.1.b.3&lt;/P&gt;
&lt;P&gt;1.A.1.b.4&lt;/P&gt;
&lt;P&gt;1.A.1.b.5&lt;/P&gt;
&lt;P&gt;1.A.1.b.6&lt;/P&gt;
&lt;P&gt;1.A.1.b.7&lt;/P&gt;
&lt;P&gt;1.A.1.c.1&lt;/P&gt;
&lt;P&gt;1.A.1.c.2&lt;/P&gt;
&lt;P&gt;1.A.1.d.1&lt;/P&gt;
&lt;P&gt;1.A.1.e.1&lt;/P&gt;
&lt;P&gt;1.A.1.e.2&lt;/P&gt;
&lt;P&gt;1.A.1.e.3&lt;/P&gt;
&lt;P&gt;1.A.1.f.1&lt;/P&gt;
&lt;P&gt;1.A.1.f.2&lt;/P&gt;
&lt;P&gt;1.A.1.g.1&lt;/P&gt;
&lt;P&gt;1.A.1.g.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe your code sums all of the elements per occupation. Assuming that, I went ahead and printed the first 10 observations, and the index for the first occupation does not equal to the sum of all of its the elements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other suggestions to fix this and narrow the code to those specific 21 element IDs, I would greatly appreciate it!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!!&lt;/P&gt;
&lt;P&gt;Diana&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 04:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/446999#M283277</guid>
      <dc:creator>Diana_AdventuresinSAS</dc:creator>
      <dc:date>2018-03-20T04:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/447250#M283278</link>
      <description>&lt;P&gt;Then add the ElementId to the where statement to subset the data to just those records:&lt;/P&gt;
&lt;P&gt;This example would only sum when the elementid is one of the first 3. Finish adding the remainder in the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the list of the elementids NOT to use is shorter it may be easier to use this code:&amp;nbsp; &amp;nbsp;and elementid not in ('1.A.1.a.5' 1.A.1.a.6' ) and continue to list all of the ones you don't want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary data=yourdataset nway;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where scalename='Importance'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and elementid in ('1.A.1.a.1' '1.A.1.a.2' '1.A.1.a.3')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class OCCSOC;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var datavalue;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; output out=want (drop=_type_ _freq_)&amp;nbsp;sum= cognitiveindex;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 19:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/447250#M283278</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-20T19:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: index score for occupations summarizing a multiple variable scores</title>
      <link>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/447324#M283279</link>
      <description>&lt;P&gt;Thank you so much!! It worked beautifully. You are amazing. You made a huge difference in this grad student's life. God bless!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diana&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/index-score-for-occupations-summarizing-a-multiple-variable/m-p/447324#M283279</guid>
      <dc:creator>Diana_AdventuresinSAS</dc:creator>
      <dc:date>2018-03-21T04:39:52Z</dc:date>
    </item>
  </channel>
</rss>

