03-12-2025
tebert
Obsidian | Level 7
Member since
07-01-2016
- 30 Posts
- 14 Likes Given
- 0 Solutions
- 5 Likes Received
-
Latest posts by tebert
Subject Views Posted 934 07-21-2022 09:25 AM 1324 07-21-2022 09:15 AM 1221 09-20-2021 07:25 PM 1238 09-20-2021 07:13 PM 1301 09-20-2021 05:17 PM 3087 09-17-2019 10:07 AM 3113 09-17-2019 09:15 AM 1469 05-23-2018 05:56 PM 1855 02-18-2018 05:18 PM 9234 08-21-2017 10:31 PM -
Activity Feed for tebert
- Posted Failure in copy-paste from SAS results to Excel on SAS Programming. 07-21-2022 09:25 AM
- Tagged Compact letter display for Tukey or MCP on SAS Programming. 07-21-2022 09:16 AM
- Posted Compact letter display for Tukey or MCP on SAS Programming. 07-21-2022 09:15 AM
- Tagged Compact letter display for Tukey or MCP on SAS Programming. 07-21-2022 09:15 AM
- Posted Re: Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 07:25 PM
- Liked Re: Reorder lsmeans columns in GLM for Reeza. 09-20-2021 07:16 PM
- Posted Re: Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 07:13 PM
- Liked Re: Reorder lsmeans columns in GLM for PaigeMiller. 09-20-2021 07:05 PM
- Posted Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 05:17 PM
- Tagged Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 05:17 PM
- Tagged Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 05:17 PM
- Tagged Reorder lsmeans columns in GLM on SAS Programming. 09-20-2021 05:17 PM
- Liked Re: How do I get Normal quantiles? for PeterClemmensen. 09-17-2019 10:20 AM
- Posted Re: How do I get Normal quantiles? on SAS Programming. 09-17-2019 10:07 AM
- Posted How do I get Normal quantiles? on SAS Programming. 09-17-2019 09:15 AM
- Got a Like for Re: out of memory error on PC running SAS. 10-14-2018 10:24 PM
- Liked Re: How to extract model SS from GLM for ChrisHemedinger. 05-23-2018 10:19 PM
- Posted How to extract model SS from GLM on SAS Programming. 05-23-2018 05:56 PM
- Posted Sample size estimation from proc glimmix output in multiple comparison procedure on Statistical Procedures. 02-18-2018 05:18 PM
- Got a Like for Re: Processing all the files from a folder. 08-21-2017 11:01 PM
-
Posts I Liked
Subject Likes Author Latest Post 2 3 1 1 4 -
My Liked Posts
Subject Likes Posted 1 09-01-2016 09:15 AM 2 08-21-2017 10:31 PM 2 07-22-2016 12:44 PM
07-21-2022
09:25 AM
In older SAS I could select-all in the results window (SAS enterprise), copy and paste into Excel. I would get all the tables and graphs. Now I tried it and I still get the tables but the graphics did not make it. Is there a solution?
... View more
07-21-2022
09:15 AM
I use proc glm, and glimmix mostly. I like seeing the residual plots that I get from "plots=" statements in the procedure call. With ods graphics on I get the residuals plots and I get a bar plot of differences from the multiple comparison procedure (MCP) With ods graphics off I do not get the residuals plots but I get the results from the MCP as a compact letter display format. Must I run the analysis twice to get the residuals plots and the MCP as a compact letter display? I tried "ods graphics on" right before the "proc glm" statement and an "ods graphics off" right afterwards and that did not work. Tim
... View more
09-20-2021
07:25 PM
It will work to put any one column first. I could put a space in front of "Pink" to move that to the front. I suspect I could also order others by adding multiple spaces. However, with many spaces there will be other issues so adding spaces is not a general solution. It only gets me through today.
... View more
09-20-2021
07:13 PM
PaigeMiller gave a solution that gets me through today. I have not used SGPlot or mapping so it will take more effort to see how well I gan get these suggestions to work. This answer will be a more general solution.
... View more
09-20-2021
05:17 PM
I used the following code, but I want the columns in a different order. ods graphics on;
proc glm plots=diagnostics;
class trt;
model pct_Juice Brix Acid Ratio BrimA = trt;
lsmeans trt/adjust=tukey alpha=0.05 lines;
run; Here is the default graph, but the columns are in alphabetical order. I want "Control" as the first column on the left.
... View more
09-17-2019
10:07 AM
I think you gave me the answer that I need. All I would need to do is to replace the number in "by .025" in your example with 1/n where n is the number of observations in my dataset. In response to your question: I can get a qq plot in proc glm . proc glm plots=diagnostics; model a=b c; run; I can also use Proc Univariate. proc glm;
model a=b c;
output out=data2 r=resid;
run;
proc univariate;
var resid;
qqplot resid;
run; The plot is not exactly equivalent as the diagnostic plot in Proc GLM has a line to indicate a normal distribution. The goal is not to generate a qq plot. The qq plot from proc glm shows a clear break point where the slope of the plotted residuals changes. There is a possible biological explanation for this where light levels are insufficient to maintain C4 photosynthesis. I need to identify that break point in the data to see if that explanation works or not.
... View more
09-17-2019
09:15 AM
How do I generate a new varaible in my dataset that has the quanitles of the normal distribution such that when I graph the new variable and the residuals I would get the equivalent of the qqplot statement in proc Univariate?
... View more
05-23-2018
05:56 PM
I am running a MANOVA in proc GLM. I would like to extract the model sums of squares into a new data set. How is this done? I can do this the hard way using this code: %macro repete (new, in=inone);
%do i=2000 %to 5000 %by 5;
data &new; Set &new;
if LeafCa le &i/1000 THEN GROUP=1; ELSE GROUP=2;
PROC Glm outstat=twos;
CLASS GROUP;
MODEL AvgStarchugdivmm2=GROUP SPAD SLAcm2divg LeafP LeafFeppm SoilBufferpH6inch;
%end;
%mend repete;
%repete(one, in=one);
run; I can then copy and paste the results into Excel, and extract the model SS from there. While slow, I will do that if I must. It is a Cate-Nelson analysis.
... View more
02-18-2018
05:18 PM
I have a data set with 84 variables, and a treatment variable with 4 states (a, b, c and d). For variable 1, I want to know if there are mean differences between the 4 treatments. I then test variable 2, and so forth. I use proc GLIMMIX, and an lsmeans statement with adjust=tukey. For the variables that show no significant differences, is there a way to get SAS to calculate the sample size that would be needed to get a significant outcome? I would be happy if I could get the calculation for all of the variables and then process the output by hand to get only the non-significant variables. There will be a sample size needed to get a significant difference between a and b, and this will be different than the sample size necessary to get b different than d. There are six possible values, but I am mostly just interested in the smallest value that will give at least one significant difference. The SAS code looks like this, where the independent variable in NumPrbs, and trt is short for treatment : Proc glimmix plots=residualpanel;
class trt;
model NumPrbs=trt;
lsmeans trt/adjust=tukey pdiff lines;
title 'ANOVA & LSD of NumPrbs'; Here is data from NumPrbs. Values are not integer because the data were transformed: a 5.291503 a 4.472136 a 6.78233 a 5.477226 a 3.316625 a 3.741657 a 4.795832 a 2.645751 a 5.385165 a 4.690416 a 5.91608 a 3.464102 a 2.236068 a 4.242641 a 3.605551 a 2 a 3.316625 a 3.464102 a 4.472136 a 3 a 3.162278 a 4.242641 b 6.557439 b 6.164414 b 7.141428 b 5.830952 b 1.732051 b 2.236068 b 7.071068 b 4.898979 b 2.236068 b 4.795832 b 2.44949 b 4 b 5.477226 b 5.291503 b 5.291503 b 4.898979 b 4.358899 b 6.324555 b 4.358899 b 5.656854 b 3.605551 b 3.316625 b 6.324555 c 8.660254 c 3.316625 c 4.582576 c 4.472136 c 5.09902 c 7 c 2.44949 c 4.898979 c 3 c 4.898979 c 1.732051 c 5.477226 c 2.828427 c 3.162278 c 7.28011 c 4.242641 c 6.557439 c 5.09902 c 4.242641 c 6.164414 c 2.645751 c 4.690416 c 4.795832 c 2.236068 d 5.385165 d 4.358899 d 5.477226 d 2.236068 d 5.567764 d 3.162278 d 3.741657 d 2.236068 d 4.582576 d 8.944272 d 6.78233 d 5.385165 d 7.483315 d 5.477226 d 8.831761 d 4.123106 d 6.164414 d 6.78233 d 3.162278 d 6
... View more
08-21-2017
10:31 PM
2 Likes
Thank you. This collapsed a somewhat convoluted program down into a few lines. The old program read the first variable as character because that was the first value. The other variables are then missing. The next line is read using the same format. Alternate lines are moved to two different data sets. Set1 has the character variable, Set2 has the numeric values. The sets are then merged. Your solution is much better. Thank you for describing how the program works. Awesome.
... View more
08-21-2017
04:56 PM
I am using Enterprise Guide 7.4 running SAS 9.4 under Windows 10. Problem: I have hundreds of files with the same format (I'll attach three examples). There is a line of text alternating with a line of numbers. I want to read all the files in a folder. Each file needs to be reorganized by making the text string a new variable paired with the number string. The name of each file is also added for each row of data in the data file. The results from all files are appended and saved. This example comes from http://support.sas.com/kb/41/880.html, with minor modifications. filename DIRLIST pipe 'dir "C:\Users\tebert\Desktop\Data_Folder\*.txt" /b'; data dirlist ; infile dirlist lrecl=200 truncover; input file_name $100.; run; data _null_; set dirlist end=end; count+1; call symputx('read'||put(count,10.-l),cats('C:\Users\tebert\Desktop\Data_Folder\',file_name)); call symputx('dset'||put(count,10.-l),scan(file_name,1,'.')); if end then call symputx('max',count); run; options mprint symbolgen; %macro readin; %do i=1 %to &max; data &&dset&i; infile "&&read&i" lrecl=1000 truncover dsd missover; input var1 $ var2 $ var3 $ var4 $ var5 $ var6 $ var7 $ var8 $ var9 $ var10 $; run; %end; %mend readin; %readin; run; It runs, but I have three questions: 1) I would like to run the attached macro on each file. 2) The program reads each file saved in dirlist. I would like to have the file name added to each row of data in the file. 3) I would like to append all of the files to make one data file. Here is the macro: %Macro Manip; Data one; set one; retain insectno2; if insectno2<1 then insectno2=0; insectno2=insectno2+1; Data two three; set one; if mod(insectno2,2) eq 1 then output two; if mod(insectno2,2) eq 0 then output three; Data two; set two; drop Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 insectno2; Data two; set two; retain insectno2; if insectno2<1 then insectno2=0; insectno2=insectno2+1; data three; set three; var9=var8; var8=var7; var7=var6; var6=var5; var5=var4; var4=var3; var3=var2; var2=var1; var1=var1; /*Use "waveform;" in place of "var1;" to switch to TBF values.*/; data three; set three; drop waveform insectno2; data three; set three; retain insectno2; if insectno2<1 then insectno2=0; insectno2=insectno2+1; data two; set two three; merge two three; by insectno2; data two; set two; drop Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9; %mend; Thank you for your help. Regards, Tim
... View more
04-06-2017
04:55 PM
The rain in Spain is on average deposited on the plain subject to some standard deviation and possible outliers. Sigh, it is just not catchy. Maybe needs a slight rewrite. That is probably why my day job is not writing lyrics. Thank you for your help.
... View more
04-06-2017
01:27 PM
So in my case the correct description for the whisker would be as follows. The upper whisker is the largest data value that does not exceed 1.5 times the interquartile range above the 75th percentile. The lower whisker is the smallest data value that is not less than 1.5 times the interquartile range below the 25th percentile. Is this correct?
... View more
04-06-2017
12:16 PM
This is from the SAS website: http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_boxplot_sect028.htm (last accessed 04-06-2017) The whiskers are not always the range. It depends on the options used in BoxPlot. Here is the SAS code from the example: title 'Analysis of Airline Departure Delays'; title2 'BOXSTYLE=SCHEMATICIDFAR'; proc boxplot data=Times; plot Delay*Day / boxstyle = schematicidfar nohlabel; id Reason; label Delay = 'Delay in Minutes'; run; I attached a copy of the figure. I added a pair of red lines that are 1.5 times the distance between the 25th and 75th percentile. I also added a pair of black lines on a neighboring box that are 1.5 times the distance from the median to the 25th percentile. One line is this distance from the 25th percentile, the other line is this distance from the median. None of the lines match up with the whiskers. It is obvious that these whiskers are not the range because there are outliers that are plotted that lie outside the whiskers.
... View more
04-06-2017
11:23 AM
The issue is with the results in Figure 24.3.4 as part of Example 24.3 Creating Various Styles of Box-and-Whisker plots in the SAS/Stat user's manual. The problem is with the whiskers in the figure. The text states that the interquartile range is the difference between the 25th and 75 quartile (the height of the box). The whiskers are 1.5 times the interquartile range beyond the edges of the box. Yet in figure 24.3.4 there is no way that the lower whisker for "16Dec88" is 1.5 times the box height past the 25th percentile. Something doesn't add up. The problem is that using the SAS code from the example on my data gives me a figure that seems to have this same problem, and I don't know how to explain the output.
... View more