Recently in the SAS Community Library: SAS' @BethEbersole reveals 4 steps to stop money laundering, solve law-enforcement cases, find missing children and more with SAS Visual Investigator.
Hi, I have a fiction dataset that I've created like this data countries;
length country $20 country_1 $50;
input country $ country_1 $;
datalines;
AE United Arab Emirates
AR Argentina
AU Australia
Africa Africa
Asia Asia
CA Canada
CH Schweiz
CN China
DE Germany
ET Etiopia
EU Europe
FR France
GB United Kingdom
GM Gambia
KR Republic of Korea
KZ Kazakstan
Latin_America_31 Latin America-31
Middle_East Middle East
NO Norway
NP Nepal
NZ New Zealand
Non_EU_Europe Non-EU Europe
PE Peru
PH Philippines
RU Russia
TR Turkey
UA Ukraine
World World
;
run;
data countries_extended;
set countries;
do i = 1 to ceil(ranuni(0) * 100); /* Upprepa varje land slumpmässigt upp till 100 gånger */
output;
end;
drop i;
run; and I have SAS 9.4 - which mean it can't take union all, and such. How do I create a variable a variable hierarchy, beacuse now it is mixed in col=country. I've read that you can self join in this case, but the output was bad.. Which I tried to do, but it didn't went well. Can someone please help me out?
... View more
I trying to create a stacked bar chart comparing MA and TM groups on 8 different binary variables (I've only shown 2 here for simplicity) and 1 discrete (0-8) continuous variable. I've created a chart for the continuous variable, and it's pretty close to what I need. Here's what I need to change:
1) The bars are the same color, so it's not clear which group is higher/lower.
2) I'd like to add the name of the group that goes to each color.
3) I need to replace the variable name total_qual_care_score with a label such as "Total Quality of Care Score".
For the binary variables, I'd like to have both in a single chart. I haven't been able to create an example chart, but imagine that only the 0 and 1 bars exist. And instead of 0 and 1, the columns represent ACC_HCTROUBL_r and ACC_HCDELAY_r (with the labels "Trouble getting care" and "Delay in getting care", respectively).
Here's my current code with sample data:
data have;
infile datalines dsd dlm=',' truncover;
input Obs cohort_flag MA_non_ADRD_group TM_non_ADRD_group total_qual_care_score ACC_HCTROUBL_r ACC_HCDELAY_r;
datalines;
1,1,1,0,7,1,0
2,1,0,1,7,0,1
3,1,0,1,7,1,0
4,1,0,0,1,0,1
5,1,0,0,8,0,1
6,1,0,1,7,0,1
7,1,0,1,3,1,0
8,1,0,1,7,0,1
9,1,0,1,8,1,0
10,1,1,0,5,0,1
11,1,1,0,8,0,0
12,1,0,1,8,1,1
13,1,1,0,8,0,1
14,0,,,7,0,1
15,1,0,1,8,0,1
16,1,0,1,8,0,0
17,1,1,0,8,0,1
18,1,0,0,7,0,0
19,1,1,0,8,1,0
20,1,0,1,6,0,1
21,1,0,1,7,1,1
22,1,1,0,7,0,0
23,1,0,1,5,1,0
24,1,0,1,8,0,1
25,1,0,1,8,0,1
; RUN;
title1 "Section 1.2 -- Fig1 Unadj rates quality care TM vs MA without ADRD";
title2 "Version &version.";
PROC MEANS data=have mean n lclm uclm stackods;
class total_qual_care_score;
var TM_non_ADRD_group MA_non_ADRD_group;
ods output summary=temp.TM_MA_groupMean;
WHERE cohort_flag = 1 AND (TM_non_ADRD_group = 1 OR MA_non_ADRD_group = 1);
RUN;
PROC SGPLOT data=temp.TM_MA_groupMean;
vbarparm category=/*variable*/ total_qual_care_score response=mean /
limitlower=lclm
limitupper=uclm;
label mean="Proportion satisfied";
RUN;
... View more
The SAS 9 team is looking at ways to improve the deployment and migration experience when moving to a newer version of SAS 9. One of the projects we are looking at is the usage of Deployment Tester, including SAS Installation Qualification Tool (SAS IQ) and SAS Operational Qualification Tool (SAS OQ), to validate deployments are functioning as expected. If you use Deployment Tester, we'd love to hear about your process and any challenges you've encountered with the tool. Any information is valuable, do you run it as is or have you added any tests for the Deployment Tester to run? What kind of things are you validating or expecting the tool to validate?
Please take a moment to share your thoughts by responding to this post, or to me if that's more comfortable, by May 24th. Your experiences, suggestions, and observations are incredibly valuable to us. We appreciate you taking the time to share this information with us.
Thank you for being part of our journey towards continuous improvement of the SAS 9 products!
... View more
I am currently analyzing the impact of an intervention on medication numbers using difference-in-difference analysis, but I have encountered several challenges. Following the SAS support instructions, I conducted the difference-in-difference analysis. However, I noticed a discrepancy between my results and SAS's example (Usage Note 61830: Estimating the difference in differences of means). In the example, the value of 'Mean Estimate' in 'Contrast Estimate Results' is identical to the 'Estimate' in 'Least Squares Means Estimate'. However, in my case, these values were different. I suspect this could be due to my use of the negative binomial distribution with a log link, resulting in exponential values. Consequently, I am unsure whether to rely on the 'Mean Estimate' in 'Contrast Estimate Results' or the 'Estimate' in 'Least Squares Means Estimate', and how to interpret the results." Contrast Estimate Results Label Mean Estimate Mean Confidence Limits L'Beta Estimate Standard Error diff in diff 1.51 1.49 0.41 0.0051 a*b Least Squares Means a b Estimate Standard Error z value Pr > |z| 1 1 0.77 0.00434 178.19 <.0001 1 0 0.03 0.00508 6.5 <.0001 0 1 0.72 0.00408 177.71 <.0001 0 0 0.40 0.00426 93.11 <.0001 Least Squares Means Estimate Effect Label Estimation Standard Error z value Pr > |z| time*hospitalize diff in diff 0.41 0.00509 81.01 <.0001
... View more