## why does the SolutionF doesnt work withing my simulation

Solved
Super Contributor
Posts: 328

# why does the SolutionF doesnt work withing my simulation

Please Can someone tell me why the data this ods statement in the proc mixed below does not work "ods output SolutionF=beta_&p';

The data sets beta_1 and beta_2 are not created.

%macro surv(replicates=);

%do p=1 %to &replicates;

DATA test_&p;

one   = 1;

beta0 =  1.0;

beta1 = 1.0;

beta2 =  -.5;

subsd =  -.5;

errsd =  1;

seed  = -1;

n=1;

do while (n le 100);

ni=1;

sun = rannor(seed);

do while (ni le 10);

x1 = abs(normal(6));

error = rannor(seed);

time = ni-1;

test=7*ranuni(seed)+1;  /** uniform (1,8)  */;

m1=min(time, test);

m2=max(0,time-test);

olf = (time lt test);

*grp = 0; if n le 50 then grp=1;

y = beta0*x1 + beta1*m1 +beta2*m2 + subsd*sun + errsd*error;

output test;

ni+1;

end;

n+1;

end;

*proc print data=test_&p;

*run;

ods trace on /listing;

ods output SolutionF=beta_&p;

proc mixed data=test_&p ;

class n;

model y = x1 m1 m2 sun/s ;

random int m1 m2/ type=vc sub=n ;

run;

Data ParF1_&p;

Set beta_&p;

Where Variable = "m1";

TrueTime= 1.00;

Bias = Estimate - TrueTime;

PercentBias = (Bias/TrueTime)*100;

If (Estimate - 1.96*StdErr) le TrueTime le (Estimate + 1.96*StdErr) then typeoneerror = 0; Else typeoneerror = 1;;/*covarage probabilty*/

If Probt le 0.05 then p=1; else p=0;

Run;

data ParF1;                             /

set  ParF1_1- ParF1_&p;

run;

%end;

%mend surv;

%surv(replicates=2);

ods html;

Proc Means Data = ParF1 NOPRINT;

Var Estimate StdErr Bias PercentBias  p typeoneerror ;

Output out =F1time Mean= Estimate StdErr Bias PercentBias  p typeoneerror;

run;

proc print data=F1time;

run;

Accepted Solutions
Solution
‎09-14-2014 09:44 PM
Posts: 5,535

## Re: why does the SolutionF doesnt work withing my simulation

I get ODS dataset beta_1 when I replace

output test;

with

output test_&p;

in the datastep. I didn't try asking for a second replicate.

PG

PG

All Replies
Super User
Posts: 23,758

## Re: why does the SolutionF doesnt work withing my simulation

I think its supposed to be ODS TABLE not ODS OUTPUT.

Solution
‎09-14-2014 09:44 PM
Posts: 5,535

## Re: why does the SolutionF doesnt work withing my simulation

I get ODS dataset beta_1 when I replace

output test;

with

output test_&p;

in the datastep. I didn't try asking for a second replicate.

PG

PG
SAS Super FREQ
Posts: 4,242