Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: Please advise- Models using gllamm

 From Daniel Kaplan To statalist@hsphsun2.harvard.edu Subject st: Please advise- Models using gllamm Date Sun, 17 Mar 2013 14:14:30 -0400

```Hi Statalisters-

I am very quickly running out of time to finish this last step in my
dissertation, and I am not only new to complex stats but have never
used gllamm.  PLEASE someone take a look at my gllamm models and give
me some insight as to how to proceed.

This is a re-post of my earlier request, as I am desperate for advice
and nobody responded as of yet.  I know there is a lot to read here,
but I figure the more details I can offer the better.

Thank you,
Dan K.

I am examining 3,300 home health care patients nested within 650 home
health care service agencies.  My dataset has sample weights for
patients and agencies, although each patient has an equal probability
of being randomly sampled from the agency where it was sampled.  I
have 6 outcome variables, two of which are continuous and normally
distributed (I have successfully usedxtmixed for accomplishing the
analyses described below using these outcomes).  In addition, one
outcome is binary and three are count variables that are highly skewed
toward zero.  The count and binary outcomes are the ones I am trying
to examine withgllamm in order to
utilize the sample weights (which I am not allowed to do with
xtmixed).  My key predictor variable is a 5-point scale.

Analysis Plan:

I am building a series of models for each outcome variable, as follows:

1. Fully Unconditional Model
2. Un-adjusted Model of the association of the key predictor with
the outcome variable
3. Model of association of key predictor with outcome, adjusted for
patient characteristics
4. Model of association of key predictor with outcome, adjusted for
patient and agency characteristics
5. Slopes-as-Outcomes Model where all effects are fixed except the
slopes and intercepts

My goal is to examine if agency characteristics influence the
relationship between patient cognitive status and service utilization
outcomes.

Variables:   (I know you often request actual variable names, so here
are a few in each category.)

Key Predictor Variable-

centcog   (Group Mean Centered, 5-point scale of cognitive status)

Outcome Variables-

totalvisits   (uncentered, count of number of service visits)
readmiss   (uncentered, binomial indicator of whether enrollment in
home care is a readmission or not [0=no, 1=yes])

Consumer Characteristics-

centage     (Group Mean Centered, age in years)
centmale    (Group Mean Centered, binomial indicator of gender
[0=female, 1=male])

Service Agency Characteristics-

centagyyrs   (Grand Mean Centered, number of years agency has been
centfte         (Grand Mean Centered, number of full-time employees
at agency)

Sampling and Weight Variables-

agynum    (sampling variable identifying the agency from which
patients are sampled)
patwt        (patient weight)
agywt       (agency weight)

Models:

Fully Unconditional Model-

gllamm totalvisits, i(agynum) family(poisson) pweight(agywt) adapt

Unadjusted Model of the association of the key predictor with the
outcome variable-

gllamm totalvisits centcog, i(agynum) family(poisson) pweight(agywt) adapt
gllamm readmiss centcog, i(agynum) family(logit) pweight(agywt) adapt

Model of association of key predictor with outcome, adjusted for
patient characteristics-

gllamm totalvisits centcog centage centmale, i(agynum)
gllamm readmiss centcog centage centmale, i(agynum) family(logit)

Model of association of key predictor with outcome, adjusted for
patient and agency characteristics-

gllamm totalvisits centcog centage centmale centagyyrs centfte,
i(agynum) family(poisson) pweight(agywt) adapt
gllamm readmiss centcog centage centmale centmale centagyyrs
centfte, i(agynum) family(logit) pweight(agywt) adapt

Slopes-as-Outcomes Model where all effects are fixed except the slopes
and intercepts-

gllamm totalvisits centcog centage centmale centagyyrs centfte,
i(agynum) nrf(2) eq(?) family(poisson) pweight(agywt) adapt
gllamm readmiss centcog centage centmale centmale centagyyrs
centfte, i(agynum) nrf(2) eq(?) family(logit) pweight(agywt) adapt

Questions:

Do the models seem appropriate, or are there mistakes in how they are built?

Is there a way to include the patient weights, or is this not
necessary because the agency weights are sufficient?

In the final set of models, I think the proper way to set the
intercepts and slopes as random effects is with nrf(2)followed by
eq(?), but I do not know if I am correct and I do not know how to
properly create those equations for the constant and slope.  Is this
the correct procedure?  And if so, how do I create those equations?
The examples are always something like eq cons: cons, but it is
obvious that some prior steps are omitted from these examples because
they don't show what "cons" is the constant for.

Do I need to use the link(log) and link(binomial) commands for these
any of these logit and poisson models?

ANY suggestions, resources, syntax edits, or advice you could offer
would be greatly appreciated.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```