BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kellychan84
Fluorite | Level 6
proc glimmix data=data1; 
  class treatment block;
  model weight = treatment;
  random block;   
run;

By using the SAS OnDemand for Academics, the default decimal number of the output is 4, how to increase to 6. Thank you very much in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Add the solution option to your model statement to have the parameterEstimates displayed. But this means you actually want a different table most likely.

 

In that case, look for the table name of the table you actually want to save.

Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...

 

Table names are documented here as well:

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glimmix_details80.htm

 

View solution in original post

11 REPLIES 11
Reeza
Super User
Not sure if there's a way in the PROC. The usual workaround is to pipe the estimates to a table and control it there.
Adding the following line to your proc will save the estimates to a dataset.


ods output parameterEstimates = want;

kellychan84
Fluorite | Level 6
It turned out this warning:
WARNING: Output 'parameterEstimates' was not created. Make sure that the output object name, label, or path is spelled correctly.
Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used.
kellychan84
Fluorite | Level 6
code
data cecal_kingdom_taxonomy;
length treatment $20;
Infile "/home/u39233094/sasuser.v94/Thesis/CSV file/1-kingdom cecal taxonomy for SAS.csv" dlm="," firstobs=5;
input diet$ treatment$ block pen pig_number DNAsamcode$ unidentifiedR unidentifiedP bacteriaR bacteriaP eukaryotaR eukaryotaP totalR totalP; run;
Proc print data=cecal_kingdom_taxonomy;
run;
proc glimmix data=cecal_kingdom_taxonomy;
class treatment block;
model unidentifiedP = treatment;
random block;
lsmeans treatment/tdiff lines;
ods output parameterEstimates = want;
run;

log:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 data cecal_kingdom_taxonomy;
75 length treatment $20;
76 Infile "/home/u39233094/sasuser.v94/Thesis/CSV file/1-kingdom cecal taxonomy for SAS.csv" dlm="," firstobs=5;
77 input diet$ treatment$ block pen pig_number DNAsamcode$ unidentifiedR unidentifiedP bacteriaR bacteriaP eukaryotaR
77 ! eukaryotaP totalR totalP;
78 run;

NOTE: The infile "/home/u39233094/sasuser.v94/Thesis/CSV file/1-kingdom cecal taxonomy for SAS.csv" is:
Filename=/home/u39233094/sasuser.v94/Thesis/CSV file/1-kingdom cecal taxonomy for SAS.csv,
Owner Name=u39233094,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=03Jun2021:11:31:01,
File Size (bytes)=3921

NOTE: 35 records were read from the infile "/home/u39233094/sasuser.v94/Thesis/CSV file/1-kingdom cecal taxonomy for SAS.csv".
The minimum record length was 99.
The maximum record length was 109.
NOTE: The data set WORK.CECAL_KINGDOM_TAXONOMY has 35 observations and 14 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 790.53k
OS Memory 39336.00k
Timestamp 06/08/2021 09:22:05 PM
Step Count 132 Switch Count 2
Page Faults 0
Page Reclaims 94
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264


79 Proc print data=cecal_kingdom_taxonomy;
80 run;

NOTE: There were 35 observations read from the data set WORK.CECAL_KINGDOM_TAXONOMY.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.16 seconds
user cpu time 0.17 seconds
system cpu time 0.00 seconds
memory 3365.93k
OS Memory 39336.00k
Timestamp 06/08/2021 09:22:06 PM
Step Count 133 Switch Count 0
Page Faults 0
Page Reclaims 63
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 48


81 proc glimmix data=cecal_kingdom_taxonomy;
82 class treatment block;
83 model unidentifiedP = treatment;
84 random block;
85 lsmeans treatment/tdiff lines;
86 ods output parameterEstimates = want;
87 run;



NOTE: Convergence criterion (GCONV=1E-8) satisfied.
WARNING: Output 'parameterEstimates' was not created. Make sure that the output object name, label, or path is spelled correctly.
Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used.
NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 0.12 seconds
user cpu time 0.12 seconds
system cpu time 0.01 seconds
memory 4969.46k
OS Memory 41476.00k
Timestamp 06/08/2021 09:22:06 PM
Step Count 134 Switch Count 13
Page Faults 0
Page Reclaims 900
Page Swaps 0
Voluntary Context Switches 76
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 1632


88
89 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
101
ballardw
Super User

The ODS OUTPUT statement(s) should go either immediately prior to the proc or as part of the Procedure code and have to rerun the procedure with the option on such as:

 

ods output parameterestimates= myparmdataset;
proc glimmix data=data1; class treatment block; model weight = treatment; random block; run; 

 

kellychan84
Fluorite | Level 6
Also got this warning
WARNING: Output 'parameterEstimates' was not created. Make sure that the output object name, label, or path is spelled correctly.
Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used.
Reeza
Super User

Add the solution option to your model statement to have the parameterEstimates displayed. But this means you actually want a different table most likely.

 

In that case, look for the table name of the table you actually want to save.

Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...

 

Table names are documented here as well:

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glimmix_details80.htm

 

kellychan84
Fluorite | Level 6
Hi Reeza,
it works now, thank you so much!

The code is
ods output LSMeans = myparmdataset;
proc glimmix data=data1;
class treatment block;
model weight = treatment;
random block;
lsmeans treatment/tdiff lines;
run;
proc print data=myparmdataset;
format estimate D8.6
stderr D8.6;
run;
kellychan84
Fluorite | Level 6
the ods statement as part of the glimmix procedure also works.
PaigeMiller
Diamond | Level 26

When CLASS variables are present, the default behavior of PROC GLIMMIX is to NOT produce parameter estimates, and so no output data set parameterestimates. But, this option fixes the issue

 

  model weight = treatment/solution;

Which brings us to a philosophical discussion. SAS (and others) thinks that if you have a class variable, you want to compare means and not really fit a model. I happen to agree with that, for what it's worth (and no, SAS isn't paying me anything to say that). You apparently have the opposite opinion, you want to do the model fit with class variables, and not compare means. Of course, that's not wrong, and you are certainly entitled to fit the model instead of compare the means. But you might want to think about it more, and see if what you really need to know is the difference between the means.

--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 1488 views
  • 3 likes
  • 4 in conversation