Skip to content

tabmeans.svy has hard-coded Age~Sex model #3

@tslumley

Description

@tslumley

In tabmeans.svy there is the code

    if (num.groups == 2) {
        fit <- svyttest(formula, design = design)
        diffmeans <- -fit$estimate
        diffmeans.ci <- -rev(as.numeric(fit$conf.int))
        p <- fit$p.value
    }
    else {
        fit1 <- svyglm(Age ~ 1, design = design)
        fit2 <- svyglm(Age ~ Sex, design = design)
        fit <- do.call(anova, c(list(object = fit1, object2 = fit2), 
            anova.svyglm.list))
        p <- as.numeric(fit$p)
    }

I suspect the else branch was a working example or something?

I found this because of a StackOverflow question:
https://stackoverflow.com/questions/62213203/issue-with-the-tabmeans-survey-multi-categorical-variables-not-recognising-vari/62239174#62239174

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions