Below we have specified “independence” which means we’re not allowing responses within subjects to be correlated. ![]() (It’s important to note that gee assumes the data frame is sorted according to the id variable.) The last argument, corstr, allows us to specify the correlation structure. In this case it’s the “id” column in the data frame. The id argument specifies the grouping factor. We also have the familiar data and family arguments to specify the data frame and the error distribution, respectively. Notice the formula syntax is the same we would use with a mixed-effect model in R. If you don’t have the gee package, uncomment and run the first line of code below. (This means we’re allowing the response trajectory to vary depending on drug.) We’ll use the gee function in the gee package to carry out the modeling. We’ll also allow an interaction for drug and time. Now let’s use GEE to estimate a marginal model for the effect of diagnosis, drug and time on the depression response. With(dat, tapply(depression, list(diagnose, drug, time), mean)) %>% At each time point, the subject’s depression response was a “1”, which in this case means “Normal”. We see subject 1 (id = 1) had a “mild” diagnosis and was treated with the “standard” drug at times 0, 1, and 2. Below we read in the data from a CSV file, set “standard” as the reference level for the drug variable, and look at the first three rows. The data we’ll use comes from Table 11.2 of Agresti (2002) and concerns a longitudinal study comparing two drugs (“new” versus “standard”) for treating depression. Let’s work through an example to compare and contrast GEEs and mixed-effect models. This is not something that’s currently possible in the popular lme4 package. For example, we can specify that the correlation of measurements taken closer together is higher than those taken farther apart. GEE allows us to specify a correlation structure for different responses within a subject or group. GEE does not use the likelihood methods that mixed-effect models employ, which means GEE can sometimes estimate more complex models.īecause GEE doesn’t use likelihood methods, the estimated “model” is incomplete and not suitable for simulation. GEE computations are usually easier than mixed-effect model computations. This is something better suited for a mixed-effect model. It cannot easily accommodate more complex designs such as nested or crossed groups for example, nested repeated measures within a subject or group. GEE is intended for simple clustering or repeated measures. We can also obtain a population-level model from a mixed-effect model, but it’s basically an average of the subject-specific models. This in turn provides insight to the variability between subjects or clusters. In other words, the parameter estimates are conditional on the subject/cluster. They allow us to estimate different parameters for each subject or cluster. Mixed-effect/Multilevel models are subject-specific, or conditional, models. The main difference is that it’s a marginal model. We often model longitudinal or clustered data with mixed-effect or multilevel models. In this article we simply aim to get you started with implementing and interpreting GEE using the R Statistical Computing Environment. If interested, see Agresti (2002) for the computational details. The name refers to a set of equations that are solved to obtain parameter estimates (ie, model coefficients). It is usually used with non-normal data such as binary or count data. Generalized Estimating Equations, or GEE, is a method for modeling longitudinal or clustered data.
0 Comments
Leave a Reply. |