<?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: Star (*) for Importance/Weight in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/799003#M314125</link>
    <description>&lt;P&gt;So here's the code under the data:&lt;/P&gt;&lt;PRE&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.query AS &lt;BR /&gt;SELECT 'year'n , id , statefips , male , raceethnic , ed , marst , nchild , occ , ind , wkswork , age , income FROM _TEMP0.db1;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;PROC DATASETS NOLIST NODETAILS;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;data work.details;&lt;BR /&gt;  set work.query (drop='year'n);&lt;BR /&gt;  run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Attached is what the data looks like&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Feb 2022 20:44:55 GMT</pubDate>
    <dc:creator>ccherrub</dc:creator>
    <dc:date>2022-02-27T20:44:55Z</dc:date>
    <item>
      <title>Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798857#M314053</link>
      <description>&lt;P&gt;I'm not sure exactly what the process is called but here is my code:&lt;/P&gt;&lt;PRE&gt;data work.details;&lt;BR /&gt;	keep  /*mean method probt Star class*/ income male    MeanEdited ColumnName;&lt;BR /&gt;	where male ne "Pooled";&lt;BR /&gt;	&lt;BR /&gt;	length Star $3;&lt;BR /&gt;	if probt=. then Star="";&lt;BR /&gt;	else if Probt le 0.01 then Star="***";&lt;BR /&gt;	else if probt le 0.05 then Star="**";&lt;BR /&gt;	else if probt le 0.1 then Star="*";&lt;BR /&gt;	else Star="";&lt;BR /&gt;	&lt;BR /&gt;	format Mean dollar.2;&lt;BR /&gt;	MeanEdited=Cats(put(mean,dollar10.2),Star);&lt;BR /&gt;	&lt;BR /&gt;	length ColumnName $30;&lt;BR /&gt;	if class="1" then ColumnName="Avg. Income for Men";&lt;BR /&gt;	else if class="0" then ColumnName="Avg. Income for Women";&lt;BR /&gt;	else ColumnName="Diff. in Income. AHE";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;And the error I keep getting:&lt;/PRE&gt;&lt;DIV class=""&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;68&lt;/DIV&gt;&lt;DIV class=""&gt;69 data work.details;&lt;/DIV&gt;&lt;DIV class=""&gt;70 keep /*mean method probt Star class*/ income male MeanEdited ColumnName;&lt;/DIV&gt;&lt;DIV class=""&gt;71 where male ne "Pooled";&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: No input data sets available for WHERE statement.&lt;/DIV&gt;</description>
      <pubDate>Sat, 26 Feb 2022 16:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798857#M314053</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-26T16:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798860#M314054</link>
      <description>&lt;P&gt;Where is the source of your data?&amp;nbsp; The DATA step code you show suggests that you want to &lt;EM&gt;&lt;STRONG&gt;create&lt;/STRONG&gt;&lt;/EM&gt; work.details, but does not tell SAS where to get the data from.&amp;nbsp; In your DATA step, that would probably be done via a SET statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 16:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798860#M314054</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-02-26T16:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798877#M314058</link>
      <description>&lt;P&gt;you need to specify the input dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 17:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798877#M314058</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-02-26T17:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798985#M314113</link>
      <description>Okay so this is what I have as of now:&lt;BR /&gt;ods output ConfLimits=MeanVals ttests=PValue ;&lt;BR /&gt;proc ttest data=work.details;&lt;BR /&gt;Var raceethnic male;&lt;BR /&gt;Class male;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data MergedResults;&lt;BR /&gt;set work.details;&lt;BR /&gt;merge MeanVals PValue;&lt;BR /&gt;&lt;BR /&gt;length Star $3;&lt;BR /&gt;if probt=. then Star="";&lt;BR /&gt;else if Probt le 0.01 then Star="***";&lt;BR /&gt;else if probt le 0.05 then Star="**";&lt;BR /&gt;else if probt le 0.1 then Star="*";&lt;BR /&gt;else Star="";&lt;BR /&gt;&lt;BR /&gt;format Mean dollar.2;&lt;BR /&gt;MeanEdited=Cats(put(mean,dollar.2),Star);&lt;BR /&gt;&lt;BR /&gt;length ColumnName $30;&lt;BR /&gt;if class="1" then ColumnName="Avg. AHE for Men";&lt;BR /&gt;else if class="2" then ColumnName="Avg. AHE for Women";&lt;BR /&gt;else ColumnName="Diff. in Avg. AHE";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=MergedResults;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;And heres' the prompt for the best context:&lt;BR /&gt;"...should have one row for each race and columns should be the average income&lt;BR /&gt;for men, average income for women, and the difference in average income. In the last column, in addition to the size of the difference in average income, you should include the result of a t-test (i.e., Proc TTest) that checks whether the difference in average income between men and women of any given race is statistically significant. Use the “star” system to report the result of your test."&lt;BR /&gt;&lt;BR /&gt;**Also to note race and gender are numerical categories if that changes anything</description>
      <pubDate>Sun, 27 Feb 2022 18:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798985#M314113</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-27T18:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798988#M314116</link>
      <description>Your proc ttest does not look correct. What is the income variable called?</description>
      <pubDate>Sun, 27 Feb 2022 18:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798988#M314116</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-02-27T18:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798989#M314117</link>
      <description>It's just called income if interpretted your question right</description>
      <pubDate>Sun, 27 Feb 2022 18:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798989#M314117</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-27T18:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798992#M314119</link>
      <description>&lt;P&gt;so if you're looking for average income then the var statement in proc ttest needs to say var income. can you post your data as datelines?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Feb 2022 18:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798992#M314119</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-02-27T18:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798995#M314121</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
ods output ttests=pvalue statistics=means;
proc ttest data=dmvs;
	by race;
	class sex;
	var vsstresn;
run;
ods trace off;

data pvalue;
	set pvalue;
	where method='Pooled';
run;

data means2;
	set means;
	if method ne 'Satterthwaite';
	if class='Diff (1-2)' then classn=3;
	else if class='M' then classn=1;
	else if class='F' then classn=2;
run;

proc sort data=means2;
	by race classn;
run;

proc transpose data=means2 out=means_t prefix=c;
	by race;
	id classn;
	var mean;
run;

proc sort data=means_t;
	by race;
run;

proc sort data=pvalue;
	by race;
run;

data merged;
	merge means_t pvalue;
	by race;
	if probt &amp;gt;=0 and probt &amp;lt;=.001 then sig="***";
	else if probt &amp;gt;.001 and probt &amp;lt;=.01 then sig='**';
	else if probt &amp;gt;.01 and probt &amp;lt;=.05 then sig='*';
	else if probt &amp;gt;.05 and probt &amp;lt;=0.1 then sig='.';
	else if probt &amp;gt;.1 and probt &amp;lt;=1 then sig='';
	p=put(probt,pvalue.);
run;

proc report data=merged;
	columns race c1 c2 c3 p sig; 
	define race / "Race";
	define c1 / "Avg. Male Income";
	define c2 / "Avg. Female Income";
	define c3 / "Avg. Diff";
	define probt / "P-value";
	define sig / "Sig.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;something like that should work but again we have not seen your data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Feb 2022 19:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/798995#M314121</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-02-27T19:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/799003#M314125</link>
      <description>&lt;P&gt;So here's the code under the data:&lt;/P&gt;&lt;PRE&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.query AS &lt;BR /&gt;SELECT 'year'n , id , statefips , male , raceethnic , ed , marst , nchild , occ , ind , wkswork , age , income FROM _TEMP0.db1;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;PROC DATASETS NOLIST NODETAILS;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;data work.details;&lt;BR /&gt;  set work.query (drop='year'n);&lt;BR /&gt;  run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Attached is what the data looks like&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Feb 2022 20:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/799003#M314125</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-27T20:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Star (*) for Importance/Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/799077#M314176</link>
      <description>&lt;P&gt;ok I still don't think your proc ttest is correct. the var needs to say income. you are looking for to see if males and females had different means within a race.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 04:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Star-for-Importance-Weight/m-p/799077#M314176</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-02-28T04:56:59Z</dc:date>
    </item>
  </channel>
</rss>

