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?

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 2019 views
  • 0 likes
  • 2 in conversation