Thoughts of a Crime Show Junkie: Inadmissible Evidence
Recent Library Articles
Recently in the SAS Community Library: SAS' @RhondaWilliams reveals how SAS Law Enforcement Intelligence helps law enforcement agencies expedite detailed data entry using the Evidence Creation feature.
I have a data set with multiple variables (columns). I'm trying to get the top 10 values of each variable. However, I would like the output to be in a new dataset with a new variable called: variable_names. The row shows the top 10 values from smallest to largest. The data below is just an example. I have more than 4 input variables. Here, I am just looking at the top 3. For a bigger data set, I may look at the top 10. data example; input a b c d; datalines; 100 120 123 140 12 23 43 42 12 12 23 23 5 7 5 2 80 88 98 2 3 4 101 4 ; %let nTop = 3; proc univariate data = new_data NExtrObs=&nTop; ods select ExtremeObs; run; The proc univariate gives a separate output for each. The UNIVARIATE Procedure Variable: a Extreme Observations Lowest Highest Value Obs Value Obs 3 6 12 3 5 4 80 5 12 3 100 1 I would like to create a new data set where output with column names: Variables and the top values. For example, Variables Top1 Top2 Top3 a 12 80 100 b 23 88 120 c 5 6 1
... View more
Hi When dealing with SAS alerts, I make a description in notes before closing the alert. I always use the same sentence in the end like "Nothing suspicious found" Is there a way to make a shortcut to this text or like in word make an autotext? In stead of typing it in everytime, I would like to press fx "ALT+I"
... View more
with the following code, the chart displays a label " p-chart for yes_answer1" at the top, under the main chart title. I have two questions about that: How to remove that, i.e "p-chart for yes_answer1" ? How can I modify the chart so that the main title " P-chart of Patient Counseling by Quarter" appears at the top of the chart instead of "p-chart for yes_answer1" title "P-chart of Patient Counseling by Quarter"; proc shewhart data=tmp2; pchart yes_answer1*quarter/ markers subgroupn = total_count1 nohlabel ; LABEL yes_answer1 ="Proportion of pts counselled"; /*this would be for y axis and no issue with this*/ run; title;
... View more
Hello,
I am running an interaction but need to reorder the x axis variables from how it is displayed below to PRISm, GOLD 0 - GOLD 4. Additionally, I need to change the legend diabetes_P1 to 'diabetes at baseline' and the Title to 'Change in FEV1pp'.
Proc GLM data=working4 (rename=(change_fev1pp = Change));
class finalgold_P1 (ref='GOLD 0') diabetes_p1 (ref="No");
model Change = finalgold_P1 diabetes_p1 finalgold_p1*diabetes_p1;
lsmeans diabetes_p1 finalgold_P1/ pdiff;
format finalgold_p1 Baseline_GOLD_Stage. diabetes_p1 diabetes_baseline. diabetes_P3 diabetes_final.;
label Change ='Change in FEV1pp';
run;
Output:
I've tried:
1. Using rename for diabetes_P1. This does not work, I think due to the formatting of diabetes_P1 to diabetes_baseline.
2. I tried adding Title = 'Change in FEV1pp Over 10 Years' into the code. There are no errors, but it doesn't change the title.
Someone suggested I use ODS but I am unfamiliar with using that code. Is there an easy way to incorporate what I need into this code?
... View more
In proc reg command, When we use 'selection=' option to select the best regression model based on various criteria (e.g. aic, cp, bic, rsquare and etc..) How does SAS come up with a single best model when it needs to consider the criteria all together simultaneously? I'm curious about this because I think different criteria may rank a model differently. c.f) proc reg data = /name of data/; model Y = X1 -- Xn / selection = adjrsq mse aic bic cp best = 1; run;quit;
... View more