Multilevel piecewise logistic regression

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
IgnacioA
Posts: 6
Joined: Wed Jun 15, 2016 3:31 pm

Multilevel piecewise logistic regression

Post by IgnacioA »

Hi,

I am trying to perform a multilevel piecewise logistic regression. In this analysis I must specify the constant term in each time period, however the commmand runmlwing asks to create a constant term for all the model which is not what I would like to do.
Is there any way to suppress this term, an equivalent option to nocons in logistic regression which let me to specify each constant term?

Thank you very much!
ChrisCharlton
Posts: 1353
Joined: Mon Oct 19, 2009 10:34 am

Re: Multilevel piecewise logistic regression

Post by ChrisCharlton »

-runmlwin- does not automatically add a constant term, so you should just be able to omit adding it yourself. Could you provide more details regarding the syntax that you are using, and how you would like to change it?
IgnacioA
Posts: 6
Joined: Wed Jun 15, 2016 3:31 pm

Re: Multilevel piecewise logistic regression

Post by IgnacioA »

I would like to do something like this:

runmlwin noini_1 week1 week2 week3 cons1 cons2 cons3, ///
level3(idc: ?) ///
level2(idm: ?) ///
level1(idpr:) ///
discrete(distribution(binomial) link(logit) denom(cons) pql2) ///
mlwinsettings(optimat) ///
nopause

In this model, when week1 is effective cons1 is 1, while week2, week3, cons2 and cons3 are 0. When week2 is effective week, cons2 is 1 while week1, week3, cons1 and cons3 are 0. The same for week3 and cons3.

How should I specify the constant term (where I typed a question mark) in the syntax?

Thanks a lot!

PD: noini_1 is a dichotomous variable.
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Multilevel piecewise logistic regression

Post by GeorgeLeckie »

Hi IgnacioA,

I am not entirely sure what you are after. The question also seems more about working our what you want to do in terms of specifying your underlying statistical model rather than how to implement a given model in runmlwin. What might help is to first consider a standard piecewise linear model using linear spline basis functions. In this case we would specify something like

. runmlwin y cons week1 week2 week3, ///
level2(subject: cons) ///
level1(occasion: cons) ///
nopause

When the response is binary we would modify this to

. runmlwin y cons week1 week2 week3, ///
level2(subject: cons) ///
level1(occasion:) ///
discrete(distribution(binomial) link(logit) denom(cons) pql2) ///
nopause

In your case you extend this further to have an additional level of random effects

You may also make the random part of the model more flexible to allow subejcts to vary not just in terms of intercept shifts, but also in terms of the shape of their piecewise linear functions. There are different things you good do here including

. runmlwin y cons week1 week2 week3, ///
level2(subject: cons time) ///
level1(occasion:) ///
discrete(distribution(binomial) link(logit) denom(cons) pql2) ///
nopause

and

. runmlwin y cons week1 week2 week3, ///
level2(subject: cons week1 week2 week3) ///
level1(occasion:) ///
discrete(distribution(binomial) link(logit) denom(cons) pql2) ///
nopause

I hope that helps

George
Post Reply