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

Hello,

 

I am running a proc reg, with options: outest = data_set tableout

 

I am having a weird problem.

In my data-table "Data_set"

I have a column "_TYPE_", and it has repeated values for each regression model I run.

I only want to keep the coefficient estimates and t-stats in my table, but whenever I try:

DATA clean_data;
 
SET data_set;

if _TYPE_ = PARMS;
if _TYPE_ = T;

RUN;

I am getting an error:

NOTE: Variable PARMS is uninitialized

Which doesn't make any sense to me, given that PARMS isn't a variable, it's a value that

_TYPE_ takes on.

Why does sas think i'm referring to a variable here?

 

I only want to retain the values in my table that have a row corresponding to PARMS (parameter estimates) and T (t-statistic from my regression), for the variable _TYPE_.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

Then you need to use the quotes as below with in operator

 

DATA clean_data;
 SET data_set;
if _TYPE_ in ('T' 'PARMS' );
RUN;
Thanks,
Jag

View solution in original post

3 REPLIES 3
Jagadishkatam
Amethyst | Level 16

Then you need to use the quotes as below with in operator

 

DATA clean_data;
 SET data_set;
if _TYPE_ in ('T' 'PARMS' );
RUN;
Thanks,
Jag
UniversitySas
Quartz | Level 8
Thank you so much.

Why is this the case? Is it because the values are characters?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 471 views
  • 0 likes
  • 2 in conversation