BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LB
Quartz | Level 8 LB
Quartz | Level 8

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;

1 ACCEPTED SOLUTION

Accepted Solutions
LB
Quartz | Level 8 LB
Quartz | Level 8

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

View solution in original post

7 REPLIES 7
Reeza
Super User

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;

LB
Quartz | Level 8 LB
Quartz | Level 8

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

Reeza
Super User

You did it backwards:

ods table ParameterEstimatesGivenAR=Mytablename;

LB
Quartz | Level 8 LB
Quartz | Level 8

Reeza;

Gotcha! Not enough coffee yet in the system!

Many Thanks this is great!

Lawrence

LB
Quartz | Level 8 LB
Quartz | Level 8

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

Reeza
Super User

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.

LB
Quartz | Level 8 LB
Quartz | Level 8

I will try that. Thanks.

Lawrence

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1492 views
  • 0 likes
  • 2 in conversation