BookmarkSubscribeRSS Feed
lsandell
Obsidian | Level 7

Hi there, I am fitting a linear mixed model using PROC MIXED (see example code at bottom) in order to determine both fixed effects and a marginal slope for my population (a few hundred patients with multiple visits) (using SAS v 9.4 windowing environment). I need to bootstrap the standard errors for the fixed effects produced from my original mixed model and determine the marginal slope for each iteration of my bootstrap. For context, my marginal slope is the summed slope of slopes weighted by proportion of patients who dropped out at each unique dropout time according to: 

 

*	Estimate the slope at each dropout time by hand;
*	use fixed effects estimates from linear mixed model; 
%let B_time = -0.2; *taken from fixed effects output;
%let B_time_timelast = 0.5; *taken from fixed effects output;
data dropout;
	set dropout;
	slope = (&B_time ) + ((&B_time_timelast )*time_last)	;
run;
data marginal;
	merge dropout_prop (keep = time_last percent)
		dropout(rename = (drop_s = time_last));
	by time_last;
	pct = percent/100;
	slope_new = pct*slope;
run;
proc means data = marginal sum;
var slope_new;
run;

 

 

Using guidance from David L. Cassell's 'Don't Be Loopy', I figured I would use BY processing to improve my efficiency during my bootstrap program. I read this helpful previous thread, but I need more insight on how to accomplish my goals.

 

After the steps I've coded below, this is what I need to do next (but unsure how to accomplish with repeated measures and within bootstrap)

  1. Calculate the Marginal Slope by plugging in the average dropout time determined per Bootstrap Replicate, using the point estimates of the fixed effects for each bootstrap replicate (similar to what was done above),
  2. Get a standard error for each marginal slope (example: R has an option within LmerTest package - contest(boot, cbind(0, 1, mean_dropout_boot), joint=F) that performs a single DF t-test applied to that vector) -- is there something similar in SAS?
  3. Get a bootstrap SE (i.e., obtain standard deviation from all marginal slopes in order to calculate z-score for marginal slope for determining a p-value and CI).

I hope this makes sense. I want to be sure that I am processing efficiently since I am running the bootstrap 1000 times and have longitudinal data (which brings further concerns that I code this correctly). 

 

Thank you in advance!!

 

 

*This is my original linear mixed model: ;
proc mixed data = data method = REML;
	class subjid / ref=FIRST;
	* outp is equivalent of P in proc reg or mixed (SAS v6), 'predicted Y (p_hat) values';
	model outcome = time timeXdrop / cl outp=model_CLM;
	random intercept time / subject = subjid solution;
run;
* Bootstrap Program (beginning draft);

proc surveyselect 
	data = subjids 	
	out  = outboot 	
		seed=8642 		
		method=urs 
		samprate=1 	
		outhits 	
		rep=1000; 	
run;

ods output ConvergenceStatus = converge;
proc mixed data = data method = REML;
	class subjid/ ref=FIRST;
	by replicate;
	model outcome = time timeXdrop / cl outp=model_CLM;
	random intercept time / subject = subjid solution;
run;

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 698 views
  • 0 likes
  • 1 in conversation