0
$\begingroup$

I'd like to use a fixed-effect Poisson Regression model to examine whether opting into 2 different schemes (specified as dummies in my model) can lead to increased exercise.

I have longitudinal data, over a timespan of 3 years (data measured on a monthly basis), with N=100,000+ (each ID having varying amounts of observations/months tracked). IDs can opt into the two different schemes at any point, they can opt into one only (Scheme 1) or into neither, or into both either simultaneously or at different points in time (Scheme 1 and then Scheme 2).

I'd like to include individual fixed-effects (using within-individual variations in the opting into the two different schemes). I also want to include month/year fixed-effects to control for time trends/seasonality in exercise patterns. I am thinking of using a set of dummy variables for each specific month in a given year for this.

I'd like to specify my model as the following:

$y_{i,my} = \lambda_i + \gamma_{my} + \beta_1 Scheme1_{i,my} + \beta_2 Scheme2_{i,my} + \epsilon_{i,my}$

So $y_{i,my}$ refers to the dependent variable level of exercise performed by ID i at month m in year y.

$\lambda_i$ is the individual-specific fixed-effect.

$\gamma{my}$ is the time fixed-effect.

Scheme 1 and Scheme 2 respectively take the value 1 if the ENT i has opted into the scheme at and after month m.

FYI: Really sorry, I've had to put what each variable is defined with respect to in parenthesis in the equation above

Below is what I initially ran using the glm() function just including Schemes 1 and 2 as dependent variables and that worked fine.

PoissonModel <- glm(DepVar ~ Scheme1 + Scheme2, family = poisson, data = dataset)

My issue is I am unsure how to write the code/what to do in order to include the $\lambda_i$ and $\gamma_{my}$ in my regression too. Any help would be appreciated, thank you! Also, initial post can be found here on Stackflow, https://stackoverflow.com/q/55673521/11215846

Further info:

The dependent variable is a count variable called physical activity days. It tracks the number of days in a month that a certain level of physical exercise has been met for a particular individual. So each row of my data represents the number of days where exercise has been met for that month, for that specific individual. My entire sample's timespan is over 37 months (March 2015-April 2018). But, the important thing is I don't have 37 months' worth of data for every single individual. For example, for individual #1 I have data covering only 4 months, June 2015- September 2015 (so 4 rows of data for that individual, each row having a number for the count variable "physical activity days"). For another individual, I have data covering a span of 12 months (Jan 2017-Dec 2017). The amount of months (hence rows), I have per individual varies tremendously.

I would like to estimate the effects of the two different schemes (the two betas in my model) on the levels of physical activity days/exercise performed. I hypothesise that opting into one or both of the schemes would lead to increased exercise hence higher numbers of physical activity days per month.

I expect there to be seasonality effects on the level of physical activity/exercise performed (for example, levels of exercise may be lower in December than in January, or they may be lower during the winter vs. warmer months). Hence why I would like a year/month fixed-effects model.

I expect the number of days exercised in a month to increase once an individual opts into one (or both) of the schemes. The dependent count can go from 0 to 31 (as it is measured in days per month). In terms of under- or over-dispersion, I think over-dispersion is potentially likely.

$\endgroup$
  • $\begingroup$ How do you propose to handle the repeated measures on each participant? I would have thought you would need randim effects, so a glmm would be better. $\endgroup$ – Robert Long Apr 14 at 10:53
  • $\begingroup$ Hi Robert, Λ(i) would be the individual-specific time-invariant effect, allowing for the comparison over time within the same individual. Is this what you are referring to? $\endgroup$ – EconLiv Apr 14 at 11:11
  • $\begingroup$ Also, although I have varying amounts of observations per participant, each observation is unique in the sense that it denotes the amount of exercise performed (measured as days) for a specific month, for that specific individual. Does this makes sense? $\endgroup$ – EconLiv Apr 14 at 11:19
  • $\begingroup$ How many $i$ do you have ? Please format your equations using mathjax - they are difficult to read at present so I am unsure what they say. $\endgroup$ – Robert Long Apr 14 at 11:28
  • 1
    $\begingroup$ OK, thanks for the further details. You might want to add all of this info from these comments into the question, this way you are more likely to get other answers than just mine. $\endgroup$ – Robert Long Apr 14 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.