hi-
I am simulating log-logistic data based on the below method but does anyone have SAS code for simulating a piecewise loglogistic model with 2 parts?
thanks
*Using F = 1 / ((1 + x/alpha)**beta), CDF for LLOGISTIC (LL)*;
*Simulate a uniform (0,1) random variable, so then the LL would correspond to*;
*x=alpha*((u/(1-u))**(1/beta))*;
calling @Rick_SAS
Can you provide more details, please? Provide a reference or more details about what you mean by a "2-part piecewise log-logistic model." How many explanatory variables? How many are continuous?
One interpretation is that you want to use a segmented model where the model has one form for x < x0 and another form for x > x0. You can use PROC NLIN to fit models like this.
For simulation, you can generate a random value for x. If x < x0 then the mean value (eta) is given by the first model. Otherwise, the mean is given by the second model. The apply logistic simulation as usual: p=logistic(eta); Y = rand("Bernoulli", p); For more details, see "How to simulate data from a generalized linear model."
thanks for response. Figured out what I needed to do to simulate data I needed. I new the mixture probability so I just did
if u<=p then x=scale1*((u/(1-u))**(1/shape1)), else x=scale2*((u/(1-u))**(1/shape2)) where U is uniform(0,1) like you said.
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!
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.