06-06-2024
jrleighty
Fluorite | Level 6
Member since
09-13-2023
- 5 Posts
- 3 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by jrleighty
Subject Views Posted 746 05-29-2024 03:48 PM 735 03-08-2024 10:03 AM 931 12-11-2023 02:12 PM 1355 12-02-2023 02:54 PM 1907 09-13-2023 11:28 AM -
Activity Feed for jrleighty
- Posted Scatterplot symbol from another variable on SAS Visual Analytics. 05-29-2024 03:48 PM
- Liked Re: Match observations to make new variable for SASJedi. 03-08-2024 11:02 AM
- Posted Match observations to make new variable on SAS Programming. 03-08-2024 10:03 AM
- Posted Printing missing values from proc freq on New SAS User. 12-11-2023 02:12 PM
- Liked Re: variable x is uninitialized proc report compute block for Cynthia_sas. 12-02-2023 03:55 PM
- Liked Re: variable x is uninitialized proc report compute block for Kurt_Bremser. 12-02-2023 03:55 PM
- Posted variable x is uninitialized proc report compute block on SAS Programming. 12-02-2023 02:54 PM
- Posted Creating a character format that is not case sensitive on SAS Programming. 09-13-2023 11:28 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1
05-29-2024
03:48 PM
I have a dataset with five variables I would like to use to display the data on a graph. The data is grouped by the first variable (p) and sub-grouped by the second variable (i) along the x-axis. The fourth variable (nor) determines the height of the point along the y-axis. The fifth variable (mnor) is the mean of the nor values for each subgroup. I want to replace the circle with a unique symbol determined by the third variable (date), so that the graph is easier to interpret the results from different days the data was collected. I have been able to replace the point with the date but would prefer a symbol to minimize clutter. I've included a sample code below. The first graph is my original graph without including the date variable, and the second graph is replacing the points with the date value. data samp;
input p$ i date: date9. nor mnor;
format date date9.;
datalines;
A 0 16May2024 1.230 1.000
A 0 23May2024 0.770 1.000
A 1 16May2024 0.014 0.021
A 1 23May2024 0.028 0.021
B 0 16May2024 1.576 1.504
B 0 23May2024 1.432 1.504
B 1 16May2024 0.064 0.071
B 1 23May2024 0.078 0.071
C 0 16May2024 0.432 0.510
C 0 23May2024 0.588 0.510
C 1 16May2024 0.011 0.009
C 1 23May2024 0.007 0.009
;
title "Example Graph 1";
proc sgplot data = samp noborder;
scatter x = p y = nor /
markerattrs = (symbol=CircleFilled) group = i groupdisplay = cluster;
highlow x = p low = mnor high = mnor / nofill type = bar barwidth = 0.4 group = i groupdisplay = cluster;
xaxis type = discrete labelattrs = (size = 9) display = (nolabel);
yaxis labelattrs = (size = 9) display = (nolabel) grid;
run;
title "Example Graph 2";
proc sgplot data = samp noborder;
scatter x = p y = nor /
markercharattrs = (weight = bold) markerchar = date group = i groupdisplay = cluster;
highlow x = p low = mnor high = mnor / nofill type = bar barwidth = 0.4 group = i groupdisplay = cluster;
xaxis type = discrete labelattrs = (size = 9) display = (nolabel);
yaxis labelattrs = (size = 9) display = (nolabel) grid;
run;
... View more
03-08-2024
10:03 AM
A sample dataset is listed below: data _null_;
input V $ W $ X Y date;
datalines;
A 0 200 600 01/01/20
A 0 300 500 02/01/20
A 1 400 700 01/01/20
A 1 100 800 02/01/20
B 0 200 600 01/01/20
B 0 300 500 02/01/20
B 1 400 700 01/01/20
B 1 100 800 02/01/20
Z 0 80 500 01/01/20
Z 0 50 600 02/01/20
;
run; I am trying to create a new variable by subtracting two variables from one another and then dividing by another variable in the first variables observation (i.e. [x1-x2]/y1). I also need to match the observations using the same date. I'll be using the same set of observations to subtract with but many more observations for the other two numbers in the equation. How can I apply the above equation to create a new variable for my entire dataset? If we look at the second line in the sample dataset, the new variables will equal 0.5 since the date matches the second observation of Z (300-50/500). I will not need the Z observations in the new dataset.
... View more
12-11-2023
02:12 PM
I ran a dataset through proc freq and noticed I had missing values when I didn't expect any. Is there a way to output those values or print them so that I can determine what the issue might be?
... View more
12-02-2023
02:54 PM
I'm running the following proc report and having an issue with the compute block. The only variable created in this step is CholGroup. When I run the code, all observations for CholGroup are <200 despite some readings being above 200 and others being missing. In the log, I receive a note stating 'variable chol is uninitialized'. Any advice on how to fix this would be appreciated. proc report data=cb.blood; column subject Gender AgeGroup chol CholGroup WBC; where subject ge 990; define subject / noprint; define Gender / group width=8; define AgeGroup / group width=8; define Chol / width=8; define WBC / width=8; define CholGroup / 'Cholesterol Group' computed; compute CholGroup / character length=6; if chol lt 200 then CholGroup = '<200'; if chol gt 200 then CholGroup = '>=200'; endcomp; define wbc / display; run;
... View more
09-13-2023
11:28 AM
I have a csv file where one of the variables is entered inconsistently in terms of capital and lower-case lettering (e.g. Married, married, MARRIED, ect.). I'm wanting to format the observations to be a single-letter value (e.g. M) for all case variants without including all variants in my code. Is there a way to tell SAS to ignore case sensitivity and focus on just the spelling when formatting the data? Open to work around as well.
... View more