DATA Step, Macro, Functions and more

PROC TRANSREG deletes my variable. How to save it ?

Accepted Solution Solved
Reply
Contributor
Posts: 66
Accepted Solution

PROC TRANSREG deletes my variable. How to save it ?

Dear all,

 

my code is:

 

data example;
   input idn factor1 $ factor2 $ measurableDV;
   cards;
	2477 a1 b1 1.63
	2431 a1 b2 9.98
	2456 a1 b1 1.55
	2412 a1 b2 4.16
	2477 a2 b1 1.77
	2432 a2 b2 2.98
	2457 a2 b1 1.55
	2412 a2 b2 8.18
	2478 a3 b1 1.22
	2433 a3 b2 2.55
	2458 a3 b1 1.59
	2414 a3 b2 0.10
/* ... */
	;
	run;

proc print data = example; run;
ods select Position; proc contents order = VARNUM data = example; run; ods select default;


proc transreg data = example;
	model boxcox(measurableDV / LAMBDA = -3 to +3 BY 0.05 ALPHA = 0.001) = CLASS(factor1 factor2);
	output out = example_BoxCox;
	RUN;

proc print data = example_BoxCox; run;
ods select Position; proc contents order = VARNUM data = example_BoxCox; run; ods select default;

PROC CONTENTS shows that there is IDN variable in example data set.

But the variable is vanished in the example_BoxCox data set.

How to save it ?

 


Accepted Solutions
Solution
‎09-12-2017 11:45 AM
Super User
Posts: 19,855

Re: PROC TRANSREG deletes my variable. How to save it ?

Use the ID statement.

View solution in original post


All Replies
Solution
‎09-12-2017 11:45 AM
Super User
Posts: 19,855

Re: PROC TRANSREG deletes my variable. How to save it ?

Use the ID statement.

Super User
Posts: 11,343

Re: PROC TRANSREG deletes my variable. How to save it ?

By default most of the regression procedures will only output variables used on the model statement and requested statistics/ parameters/ values. Many other procedures have similar behavior where only the "used" variables appear in result data sets.

 

If you need other variables to appear the output that were not used then the ID as @Reeza suggest

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 79 views
  • 2 likes
  • 3 in conversation