Tuesday
PaigeMiller
Diamond | Level 26
Member since
04-12-2012
- 19,579 Posts
- 1,038 Likes Given
- 2,326 Solutions
- 7,510 Likes Received
About
SAS programmer since 1981, mostly at Eastman Kodak and Truesense Imaging, Inc., and ON Semiconductor, currently at M&T Bank in beautiful downtown Buffalo, NY. Let's go Buffalo #HornsUp
-
Latest posts by PaigeMiller
Subject Views Posted 209 Tuesday 283 Tuesday 342 Monday 363 Monday 382 Monday 475 Monday 94 Monday 265 Saturday 166 Saturday 351 Saturday -
Activity Feed for PaigeMiller
- Got a Like for Re: Split the table counting the row. yesterday
- Got a Like for Re: PROC GENMOD Interpretation. yesterday
- Got a Like for Re: How to find past data to identify whether the person has work experience in that year. Tuesday
- Liked Re: How to score elements of an array specified in another dataset for Tom. Tuesday
- Posted Re: How to find past data to identify whether the person has work experience in that year on SAS Programming. Tuesday
- Posted Re: How to find past data to identify whether the person has work experience in that year on SAS Programming. Tuesday
- Posted Re: Coloring sgplot lines by indicator variable value on Graphics Programming. Monday
- Posted Re: Coloring sgplot lines by indicator variable value on Graphics Programming. Monday
- Posted Re: Coloring sgplot lines by indicator variable value on Graphics Programming. Monday
- Got a Like for Re: Why do i use the %DO %UNTIL loop with the %SCAN macro function make a report each year in the li. Monday
- Posted Re: Why do i use the %DO %UNTIL loop with the %SCAN macro function make a report each year in the li on SAS Programming. Monday
- Got a Like for Re: Using code or Filter to extract all records not ending in '1'. Monday
- Posted Re: Using code or Filter to extract all records not ending in '1' on SAS Programming. Monday
- Got a Like for Re: Fascinating exchange with LLM. Saturday
- Got a Like for Re: Fascinating exchange with LLM. Saturday
- Got a Like for Re: Fascinating exchange with LLM. Saturday
- Got a Like for Re: Fascinating exchange with LLM. Saturday
- Posted Re: How to import all excel files from a folder also create a new variable to store the file number on SAS Programming. Saturday
- Posted Re: Fascinating exchange with LLM on SAS Programming. Saturday
- Posted Re: Pop-up message "log Window is full, select a choice" appears 15 times per macro-progr on SAS Programming. Saturday
-
My Liked Posts
Subject Likes Posted 1 a week ago 2 Tuesday 1 Monday 1 Monday 2 Saturday
Tuesday
2 Likes
proc summary data=experience nway;
class person;
var it_profession;
output out=year(drop=_type_ _freq_) max=max_it_profession maxid(it_profession(startyear))=startyear_it_profession;
run;
data final;
merge work year;
by person;
if year>=startyear_it_profession and max_it_profession=1 then it_expertise=1;
else it_expertise=0;
run;
... View more
Tuesday
Please explain the logic used that results in the final data set. The years in data set WORK do not appear to match the years in data set EXPERIENCE for each person.
... View more
Monday
@sasgorilla wrote:
Yes, essentially you could think of group as company types.
There are self-owned companies (A, B, C ...), there are small multi-owner companies (A1, B1, C1...) and there are larger interstate companies (A2, B2, C2....).
Then, imagine the intervention is a policy. The policy is turned on in certain states and not others, so you now have companies of each type that did and did not experience that policy. So, I want to visually be able to look at the self-owned companies that did have the policy versus those that did not, and do the same for the small multi-owner, larger interstate companies. I want to see in each group type whether the individual companies appear to generally follow the same trends.
Does that make sense?
So, I am out of time today, and I do not have a YES or NO answer to your question "Does that make sense?" Probably tomorrow I can get back to this.
... View more
Monday
@sasgorilla wrote:
Thanks, @PaigeMiller . Manually doing this could be a challenge.
More context: There are multiple different group types, each with anywhere from 5 to 10 + groups therein.
Each of these groups has experienced an intervention (indicator=1) or not (indicator=0).
While I have plotted one consolidated line for indicator 1 vs 0 by group type, I also want to be able to see the trend of each individual group based on their their intervention status. This is primarily a visual check to see if there are outliers within groups who aren't following the same pattern as the rest. In other words, do subgroups within the different group types follow similar trends based on the intervention status. If I can see that at a glance by these groups, then I can further tease out the outliers.
Thank you for explaining in more detail. There's no way I could provide a useful answer to the "real" problem based upon your original problem statement.
I'm still not sure I understand what you want. I don't understand this part: "There are multiple different group types, each with anywhere from 5 to 10 + groups therein." Groups within groups?
Nor am I sure I understand what plot you want. Is there any way you could DRAW the plot you want for, let's say, 4 groups, and scan it into your computer and then include it in your reply? (Or have Excel create the plot and then include it in your reply?) To include plots in your reply please use the "Insert Photos" icon (and do NOT attach files).
... View more
Monday
@sasgorilla wrote:
Hi. I am trying to make a simple line series with multiple lines where each line represents a different group. I would like each group line to be a specific color based on a binary indicator variable. In other words, if group A and B are indicator=0 I want them blue (for example), and if groups C, D, and E are indicator=1 I want them red.
How can I do that?
proc sgplot data=mydata;
series y=outcome x=time / group=type;
run;
I assume that your indicator variable is named TYPE, but you didn't specifically say that. You should always link the text that describes the problem with the actual name of the variable. Does TYPE have values A B C D E? (That's what I am assuming for this code) Or is TYPE binary?
The simplest method is to use the styleattrs command
proc sgplot data=mydata;
styleattrs datacontrastcolors=(blue blue red red red);
series y=outcome x=time / group=type;
run;
I am always uncomfortable providing code for this obviously contrived example, where C D and E all show up in identical colors on the plot, so you cannot distinguish them visually. I get the feeling that the answer above will not work on your real problem, and I think it would be much better if you explain the real problem.
... View more
Monday
1 Like
Another example of using a macro when you don't need a macro. You can obtain the same without macros, using a BY statement in PROC MEANS. In other words, a terrible question, and the student comes away from this class thinking "When I need to get statistics by year, I can do this via a macro!" which is completely the wrong lesson to learn.
... View more
Monday
1 Like
data want;
set have;
if left(reverse(varname))=:'1' then delete;
run;
This assumes that the data you provided is a character variable and not a numeric SAS variable. You replace varname with the variable's actual name. Note that the equal sign followed by a colon in row 3 of the code indicates "starts with", in other words, if the reverse of your variable value starts with a '1' then we delete that record.
Because of the fact that we don't really know what your data is, in the future, please do not present data this way. We would like to have data as working SAS data step code (examples and instructions). We do NOT want data in Excel files and we do NOT want copy and paste from Excel.
... View more
Saturday
Your favorite internet search engine finds lots of hits when you search for
SAS read all excel files in a folder
... View more
Saturday
2 Likes
See ChatGPT is bull**bleep**
(Yes I know you are using a different LLM but I don't really think that matters)
... View more
Saturday
This code sends the log to a text file which can be as large as you need it to be.
proc printto log="abc.log"; run;
%yourmacro /* Your macro call goes in between the two PROC PRINTTO statements */
proc printto; run;
... View more
Saturday
4 Likes
I’ve also peeked at SAS docs and forums
This is the full monty—every trick, no cuts.
Peeking at the docs and forum not enough. Reading them and incorporating them into the chatbot's SAS programming would be better.
More gibberish from the chatbot. Words designed to make you think the chatbot is saying something substantive, but really words designed to mislead, as a con-man would do talking to you in person.
... View more
Friday
That might work, but then the user will have to combine the files in SAS OnDemand to do any meaningful analysis, and likely this will again hit some sort of SAS data set size limit. SAS OnDemand was not designed to handle humongous amounts of data.
... View more
a week ago
My problem is, that i can't change the column variables that SAS has assigned automatically.
I would have to disagree. You can name these columns anything you want. Example:
proc import datafile="example1.xlsx" out=a(rename=(_in_bn___=billion_dollars));
run;
... View more
a week ago
2 Likes
This is the fitted predicted value from PROC GENMOD (screenshot above). I'm trying to dichotomize it, with the intent to answer questions such as, these levels of factor X (used as a predictor in my model) have a higher predicted value than other levels of factor X.
The slopes of the model coefficients will tell you if higher X produces bigger predicted values or not.
... View more
a week ago
What does the log say? Turn on the macro debugging options first by running this command
options mprint;
and then run the macro again. That should help you debug it. If you still can't figure it out, please copy and paste the log as text into the window that appears when you click on the </> icon. We need to see the entire log for the calls to the macro, not selected parts of the log.
... View more