Hi everyone,
I'm writing to anyone with expertise in LASSO regression analysis, as this is the method I'm employing to characterize outcomes after perioperative stroke in surgical patients. I have around 30 variables that I plug into my model, and I use the model to predict binary outcomes (mortality, 0 or 1). Here is the code for my regression that I have no issues with:
quietly elasticnet logit deathwin30days operyr sex2 age10 bmi ib1.race2 ib1.funcstat optime dcnscva anemia kidfdial hxchf bleeddis prsepis wtloss cdmi cdarrest emergncy aorticsurg sso2 ib1.anesthestype postoprenfail ib1.asa2 readmcva diabetes2 smoke transfusion2 ib2.surgspec2, rseed(2901)
So, no problems right? Not quite... When I go to conduct the same analysis for adverse discharge, it also works fine. But I have issues when running the regression with operation year as a categorical variable, as such:
quietly elasticnet logit advdischarge ib1.operyr2 sex2 age10 bmi ib1.race2 ib1.funcstat optime dcnscva anemia kidfdial hxchf bleeddis prsepis wtloss cdmi cdarrest emergncy aorticsurg sso2 ib1.anesthestype postoprenfail ib1.asa2 readmcva diabetes2 smoke transfusion2 ib2.surgspec2
Where only the bold term is changed to a categorical variable. When I run this model with operyr as a continuous variable, the model is fine. But it keeps returning no lamba when I run this, and I'm not sure what the problem is. It works just fine as a categorical variable in my model for mortality (deathwin30days). This is what the error message says:
lambda not selected
No minimum of cross-validation function found. Change in deviance stopping
tolerance not reached.
Any ideas on what might be the problem here? Thanks everyone!
Jaycee
I'm writing to anyone with expertise in LASSO regression analysis, as this is the method I'm employing to characterize outcomes after perioperative stroke in surgical patients. I have around 30 variables that I plug into my model, and I use the model to predict binary outcomes (mortality, 0 or 1). Here is the code for my regression that I have no issues with:
quietly elasticnet logit deathwin30days operyr sex2 age10 bmi ib1.race2 ib1.funcstat optime dcnscva anemia kidfdial hxchf bleeddis prsepis wtloss cdmi cdarrest emergncy aorticsurg sso2 ib1.anesthestype postoprenfail ib1.asa2 readmcva diabetes2 smoke transfusion2 ib2.surgspec2, rseed(2901)
So, no problems right? Not quite... When I go to conduct the same analysis for adverse discharge, it also works fine. But I have issues when running the regression with operation year as a categorical variable, as such:
quietly elasticnet logit advdischarge ib1.operyr2 sex2 age10 bmi ib1.race2 ib1.funcstat optime dcnscva anemia kidfdial hxchf bleeddis prsepis wtloss cdmi cdarrest emergncy aorticsurg sso2 ib1.anesthestype postoprenfail ib1.asa2 readmcva diabetes2 smoke transfusion2 ib2.surgspec2
Where only the bold term is changed to a categorical variable. When I run this model with operyr as a continuous variable, the model is fine. But it keeps returning no lamba when I run this, and I'm not sure what the problem is. It works just fine as a categorical variable in my model for mortality (deathwin30days). This is what the error message says:
lambda not selected
No minimum of cross-validation function found. Change in deviance stopping
tolerance not reached.
Any ideas on what might be the problem here? Thanks everyone!
Jaycee