<p>I'd like to know why my question (<a href="https://stats.stackexchange.com/questions/440348/quadratic-terms-in-glmer">Quadratic terms in glmer</a>) was closed here.</p>

<p>I think my question is not off-topic because it's about statistics and not about the programming itself. My question is regarding the quadratic and multiplication coefficients. So if I understand the theory, the programming is just putting those in the R function. In my question, it doesn't really matter if what package or function I'm using, because my question is regarding the logistic regression model coefficients!</p>

<p>My question was:</p>

<blockquote>
  <p>I'm looking for some references that explain step by step how to model logistic regression to longitudinal data (repeated measurements) in R.
  I know that I can use the "<em>lme4</em>" package and the function "<em>glmer</em>" for generalized linear mixed models, and I use it to add random effects. But I've read some stuff and sometimes people add quadratic terms and multiply and sometimes they don't. Can someone clarify me on this?</p>
  
  <p>For example, on the book "Applied Longitudinal Analysis by Fitzmaurice", in chapter 14.7, he models the logistic regression for a dataset like this: </p>
  
  <p><em>model1 &lt;- glmer(y ~ time + time2 + trt.time + trt.time2 + (1 | id), family=binomial, nAGQ=50, na.action=na.omit)</em></p>
  
  <p>where,</p>
  
  <p><em><span class="math-container">$time2 &lt;- time^2$</span></em></p>
  
  <p><em><span class="math-container">$trt.time &lt;- trt \times time$</span></em></p>
  
  <p><em><span class="math-container">$trt.time2 &lt;- trt*time2$</span></em></p>
  
  <p>Why doesn't he simply use <em>model1 &lt;- glmer(y ~ time + trt+ (1 | id), family=binomial, nAGQ=50, na.action=na.omit)</em> ???
  I run this last model in R and the AIC and BIC are basically the same.</p>
  
  <p>This is the type of questions that I'm having concerning the R code on this matter. I can't find many literature with R on logistic regression for longitudinal data, and this all very confusing. Can someone explain me when to use quadratic terms, or multiply/add them? Or recommend me a reference.</p>
  
  <p>I also found this topic <a href="https://stats.stackexchange.com/questions/200280/quadratic-terms-in-logistic-regression">LINK</a> but didn't help much.</p>
  
  <p>Thanks in advance</p>
</blockquote>
