stan-dev / stan-dev/rstanarm

MRP vignette / case study: questions concerning interaction between "male" and "age"

Open
#437 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

In the MRP vignette / case study, the model is formulated as follows:

cat_pref ~ factor(male) + factor(male) * factor(age) + 
    (1 | state) + (1 | age) + (1 | eth) + (1 | income)

My first question is if this shouldn't be

cat_pref ~ factor(male) + factor(male) : factor(age) + 
    (1 | state) + (1 | age) + (1 | eth) + (1 | income)

since factor(male) * factor(age) is equal to factor(male) + factor(age) + factor(male) : factor(age) and thus adds non-varying main effects for the age groups (which already have varying intercepts).

My second question is if it wouldn't be better (in terms of consistency) to use the following model:

cat_pref ~ factor(male) + 
    (1 | state) + (1 + factor(male) | age) + (1 | eth) + (1 | income)

i.e. to use varying slopes for male. Or was there a reason for having varying intercepts for age, but non-varying male:age interactions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with vignettes/mrp.Rmd and compare the two model formulations described in the issue. Resolve the statistical rationale for the age effects and male-by-age interaction, then update the vignette and its explanation so the chosen specification is clear and internally consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.