Hello all-
So I have the fake sample set below with dates and then values for Field A and B.
A is clearly declining over time, B is not.
I know how to export out the values such as trendhat so that I can actually produce a graph in ODS later.
However, how can I actually export out the p value in this case (for month) to demonstrate that in this case, the "trend" is or is not actually statistically significant for time.
I want to take this p value and then translate it into a legend into a graph. Everything else I know how to do.
Many Thanks
Lawrence
ps Sorry for the crude input for time. I really forgot how to manually enter data into a dataset.
DATA X;
INPUT @2 MONTH_CHAR $ A B;
MONTH=input(MONTH_CHAR,mmddyy10.);
DATALINES;
'01/01/12' 26 26
'02/01/12' 24 12
'03/01/12' 23 26
'04/01/12' 20 17
'05/01/12' 21 25
'06/01/12' 18 19
'07/01/12' 16 28
'08/01/12' 14 20
'09/01/12' 13 18
'10/01/12' 10 20
'11/01/12' 11 14
'12/01/12' 8 8
'01/01/13' 6 20
'02/01/13' 4 22
'03/01/13' 3 6
'04/01/13' 2 25
'05/01/13' 6 28
'06/01/13' 1 22
;
proc autoreg data=X ;
model A=month /nlag=2 method=ml;
output out=X_A pm=trendhat ;run;
proc autoreg data=X ;
model B=month /nlag=2 method=ml;
output out=X_B pm=trendhat ;run;
Reeza;
Very helpful-
So the table I want is
ParameterEstimatesGivenAR
But when I try to set the parameter ods table mytablename=ParameterEstimatesGivenAR-
It returns an error.
When I just use ods table ParameterEstimatesGivenAR it works finr but I cannot seem to define the table name.
Thanks again.
Lawrence
Use ODS Trace to determine the table (Check the log) and then use ods table mytablename=ptable before proc to store table.
ods trace on;
ods table tablename=my_Table;
proc autoreg data=X ;
model A=month /nlag=2 method=ml;
output out=X_A pm=trendhat ;run;
ods trace off;
proc print data=my_table;
run;
Reeza;
Very helpful-
So the table I want is
ParameterEstimatesGivenAR
But when I try to set the parameter ods table mytablename=ParameterEstimatesGivenAR-
It returns an error.
When I just use ods table ParameterEstimatesGivenAR it works finr but I cannot seem to define the table name.
Thanks again.
Lawrence
You did it backwards:
ods table ParameterEstimatesGivenAR=Mytablename;
Reeza;
Gotcha! Not enough coffee yet in the system!
Many Thanks this is great!
Lawrence
Reeza;
OK One more question-
In order to use this I need to leave the print option on-This causes all the parameters to be output into my report which I don't want-
I attempted to redirect the log to bypass this but that does not work..Is there a way to have my cake and eat it too
(i.e. get the parameters table but suppress the output from the proc autoreg)
Thanks
Lawrence
Turn of ods listings or whatever your destination is?
ODS Listing Close;
ODS LISTING;
or ODS SELECT NONE before the proc? I think that still allows you to capture the table, but not 100% sure.
ODS SELECT ALL after the proc to reset.
I will try that. Thanks.
Lawrence
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.