Error: $ operator not defined for this S4 class
You are giving as.formula
the wrong input here. Only d$sex ~ d$ahe
should be a formula, so:
ctree(as.formula("d$sex ~ d$ahe"))
Or:
ctree(as.formula("sex ~ ahe"), data = d)
stargazer Error: $ operator not defined for this S4 class
This kind of model does not appear to be supported by stargazer
, but it is supported by the modelsummary
package. (Disclaimer: I am the author.)
library(panelr)
library(modelsummary)
wages <- panel_data(WageData, id = id, wave = t)
mod <- wbm(lwage ~ union, data = dat)
modelsummary(mod)
Model 1 | |
---|---|
union | 0.055 |
(0.025) | |
(Intercept) | 6.675 |
(0.021) | |
imean(union) | 0.003 |
(0.036) | |
SD (Intercept) | 0.382 |
SD (Observations) | 0.259 |
Num.Obs. | 4165 |
R2 Marg. | 0.000 |
R2 Cond. | 0.685 |
AIC | 2262.8 |
BIC | 2294.5 |
RMSE | 0.24 |
Error: $ operator not defined for this S4 class when trying to run vuong() function
As you discovered, pscl::vuong
doesn't work with lmer
models.
There is a nonnest
package with a vuongtest function. From the example in that help page:
## Supplying custom vcov function
require(lme4)
require(merDeriv)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, REML=FALSE)
fm2 <- lmer(Reaction ~ Days + (Days || Subject), sleepstudy, REML=FALSE)
vcl <- function(obj) vcov(obj, full=TRUE)
vuongtest(fm1, fm2, vc1=vcl, vc2=vcl, nested=TRUE)
Related Topics
Tidyr Spread Function Generates Sparse Matrix When Compact Vector Expected
Block Bootstrap from Subject List
How to Plot Multiple Lines in R
Remove Certain Words in String from Column in Dataframe in R
How to Suppress R Startup Message
Using: = in Data.Table with Paste()
How to Make Install.Packages Return an Error If an R Package Cannot Be Installed
R How Many Element Satisfy a Condition
Character Extraction from String
Make List of Vectors by Joining Pair-Corresponding Elements of 2 Vectors Efficiently in R
R Markdown Add Tag to Head of HTML Output
R - Error When Using Geturl from Curl After Site Was Changed
Using Dplyr to Group_By and Conditionally Mutate a Dataframe by Group
Adding Text Labels to Tmap Plot