Broad context: I'm doing model selection, and can't use the easy automatic statements because I have a bunch of dummy coded variables + want to use likelihood ratio test. However, because I will be doing a bunch of model selection, I do want to try to automate the process as much as possible. So far what I've done is to create a macro to run the model where I can toggle each variable of interest on/off, and my thinking was that I could run a model, then toggle off a variable, store the outputs of both models, and then stack p values and sort to determine which variable to toss next until they are all significant. However, if anyone has any other strategies I am also open, I'm sure there are also other, probably better, ways to accomplish this. My current macro call looks something like this: %LRModel(var1,var2,var3,var4,var5,dataset,strata,outcome); If var1-var5 are 1 then the model includes that variable, so a full model looks like: %LRModel(1,1,1,1,1,dataset,strata,outcome); and then nested models might look like: %LRModel( ,1,1,1,1,dataset,strata,outcome); %LRModel(1, ,1,1,1,dataset,strata,outcome); %LRModel(1,1, ,1,1,dataset,strata,outcome); %LRModel(1,1,1, ,1,dataset,strata,outcome); %LRModel(1,1,1,1, ,dataset,strata,outcome); The blank can also be anything that's not a 1. I'm stuck on how I can iteratively call the full model and then the nested models, automatically without having to write out each macro call, although I feel like there's got to be a way to to do this. Any help would be much appreciated.
... View more