Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with test.statistic: the F test is always returned #305

Open
luroy opened this issue Apr 24, 2024 · 0 comments
Open

Error with test.statistic: the F test is always returned #305

luroy opened this issue Apr 24, 2024 · 0 comments

Comments

@luroy
Copy link

luroy commented Apr 24, 2024

Hello,
In trying to obtain the p-values associated with each model of the following psem [that is, type 2 Anova, F-test for lm() / type 2 Anova Likelihood ratio (LR) test for glm(..., family = poisson) and for glm.nb() / type 2 Anova, Chisq Wald test for glmer()] :

SEM<-psem(bm_lc_mod1.1<-lm(Tmi ~ 1, data = data),
                 bm_lc_mod1.3<-lm(Tma ~ p1, data = data),
                 bm_lcpwc_mod1.1b<-glm(Rich ~ p1 + Pra1 + Tmi + Tma, family = "poisson", data = data),
                 bm_lcpwc_mod1.2b<-glm.nb(AB ~ Autoc_AB + p2 + Pra2 + p3, data = data),
                 bm_lcpwc_mod1.3<-lm(Co1 ~ p1 + Pra1, data = data),
                 bm_lcpwc_mod1.4b<-lm(Co2 ~ Autoc_Co2 + Pra2, data = data),
                 bm_c_mod1.1q<-glmer(Tx_V~AB+Co1+(1|obs_V), weights=N_V, data = data, family="binomial"),
                 bm_c_mod1.2q<-glmer(Tx_P~Rich+Autoc_Tx_P+(1|obs_P),  weights=N_P, data = data, family="binomial")
)

To do this, I use the coefs() function, as follows:

#test.statistic = "F" for lm()
coefs(
  SEM,
  standardize = "scale",
  standardize.type = "latent.linear",
  test.statistic = "F",
  test.type = "II",
  intercepts = FALSE
) 
#test.statistic = "LR" for glm(, family="poisson) and glm.nb()
coefs(
  SEM,
  standardize = "scale",
  standardize.type = "latent.linear",
  test.statistic = "LR",
  test.type = "II",
  intercepts = FALSE
) 
#test.statistic = "Chisq" for glmer(, family="binomial")
coefs(
  SEM,
  standardize = "scale",
  standardize.type = "latent.linear",
  test.statistic = "Chisq",
  test.type = "II",
  intercepts = FALSE
) 

Unfortunately, the results of these three functions give exactly the same p-values, and these p-values correspond to the default F-test.
Is there any way of obtaining the correct p-values for each model?
Thank you in advance for your help,
Léa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant