Skip to content

Can't use Shinystan to look at rstanarm glmer results #128

@rayleigh

Description

@rayleigh

For a project, I used RStanarm's glmer function in the following way:

stan_fit <- stan_glmer(formula = formula(reg_formula), data = data_matrix,
family = "binomial", iter = 500, sample_file = output_filename)

However, when I tried to upload the files and look at the results in Shinystan, I got the following warnings and error messages:

> naes_one <- read_stan_csv(c("Annenberg_analysis_1_sample_output1", "Annenberg_analysis_1_sample_output2", "Annenberg_analysis_1_sample_output3", "Annenberg_analysis_1_sample_output4"))
There were 12 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In if (adapt_term_lineno == len) adaptation_info <- "" else { ... :
the condition has length > 1 and only the first element will be used
2: In (adapt_term_lineno + 1):(time_lineno - 1) :
numerical expression has 2 elements: only the first used
3: In 1:(adapt_term_lineno - 1) :
numerical expression has 2 elements: only the first used
4: In if (adapt_term_lineno == len) adaptation_info <- "" else { ... :
the condition has length > 1 and only the first element will be used
5: In (adapt_term_lineno + 1):(time_lineno - 1) :
numerical expression has 2 elements: only the first used
6: In 1:(adapt_term_lineno - 1) :
numerical expression has 2 elements: only the first used
7: In if (adapt_term_lineno == len) adaptation_info <- "" else { ... :
the condition has length > 1 and only the first element will be used
8: In (adapt_term_lineno + 1):(time_lineno - 1) :
numerical expression has 2 elements: only the first used
9: In 1:(adapt_term_lineno - 1) :
numerical expression has 2 elements: only the first used
10: In if (adapt_term_lineno == len) adaptation_info <- "" else { ... :
the condition has length > 1 and only the first element will be used
11: In (adapt_term_lineno + 1):(time_lineno - 1) :
numerical expression has 2 elements: only the first used
12: In 1:(adapt_term_lineno - 1) :
numerical expression has 2 elements: only the first used
> launch_shinystan(naes_one)

Creating shinystan object...
Error in if (.used_vb(x) || !(algo %in% c("NUTS", "HMC"))) warning("Many features are only available for models fit using\n algorithm NUTS or algorithm HMC.", :
missing value where TRUE/FALSE needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions