stan-dev / stan-dev/rstanarm

gaussian(link="cloglog")

Open
#629 0 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

An edge case perhaps, but I have data which is quite close to a cloglog curve, though the response is not binomial. This is the accumulation over time for amyloid in the brain, as measured using PET scans with Pittsburgh compound B (PIB). The following lme4 code works (age70 = (age -70)/10 , it makes glmer happier).

fit <- glmer( I(log(pib)/2) ~ age70 + male + apoepos + (1| id), pdata, family= gaussian(link= 'cloglog'), mustart= ....)

(You need mustart or glmer gets unhappy about a response outside of 0/1, but that is just starting estimates.) Subjects follow essentially the same progression curve, but shifted forward and back in time. The presence of one or more e4 alleles on the APOE gene for instance leads to amyloid accumulation about 8 years earlier, on average.

However, I wanted more control over the variance of the random effect, enter rstanarm.
But stan_glmer does not allow this link.

rstanarm_2.32.1
R version 4.3.2 (2023-10-31)
Unix

Priority: low. I'll set up STAN code for this by hand. But rstanarm would have been simpler

Terry Therneau

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 at the stan_glmer entry point and trace how Gaussian families and supported links are validated. Confirm what is required for gaussian(link="cloglog") to be accepted and how the model should behave for the non-binomial response described in the issue. Done means the requested model can be specified through rstanarm rather than requiring hand-written Stan code.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.