-
Notifications
You must be signed in to change notification settings - Fork 1
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: object of type 'symbol' is not subsettable #4
Comments
Dear Kamil, thank you for your interest in my R-package and pointing out this problem. It seems like the In the meantime, your solution using x <- "Disease"
dir1 <- eval(substitute(
DirichReg(formula = substitute_formula, data = Bld)
, list(
"substitute_formula" = as.formula(sprintf("Smp ~ %s", x))
)
))
dir1
#Call:
#DirichReg(formula = Smp ~ Disease, data = Bld)
#using the common parametrization
#
#Log-likelihood: 152.3 on 8 df (44 BFGS + 2 NR Iterations)
#
#-----------------------------------------
#Coefficients for variable no. 1: Albumin
#(Intercept) DiseaseB
# 3.4840 -0.3193
#-----------------------------------------
#Coefficients for variable no. 2: Pre.Albumin
#(Intercept) DiseaseB
# 2.9148 -0.3731
#-----------------------------------------
#Coefficients for variable no. 3: Globulin.A
#(Intercept) DiseaseB
# 2.3626 -0.2401
#-----------------------------------------
#Coefficients for variable no. 4: Globulin.B
#(Intercept) DiseaseB
# 2.85175 -0.06419
#----------------------------------------- Hope this helps for now. |
Update: The changes are now implemented in the development-version (0.7-1.9000) in the devtools::install_github("maiermarco/DirichletReg@devel") Please let me know if the issues have been resolved. |
Thanks for fixing this so quickly! I confirmed that the 2 examples with errors no longer throw errors using version 06c44ad The other examples also seem to work as before. |
Dear @maiermarco,
Thank you for creating and sharing DirichletReg with the world.
I'm writing to let you know that there is an issue with how your
DirichReg()
function handles formulas.See the reprex below for details.
This throws an error:
We can avoid the error like this:
I learned about this weird workaround thanks to kassambara/survminer#252
Setup the example
Demonstrate that the
stats::lm()
function works as expected.For these 3 examples,
DirichletReg::DirichReg()
works as expected:For these two examples, we get an issue:
Here is the workaround:
Here is how we can easily get the estimates:
Created on 2021-10-14 by the reprex package (v2.0.1)
Session info
The text was updated successfully, but these errors were encountered: