Skip to content
Snippets Groups Projects
Commit e511bde3 authored by dj44vuri's avatar dj44vuri
Browse files

small error with examples in ztest

parent c68233e7
Branches main
No related tags found
No related merge requests found
......@@ -27,5 +27,5 @@ Imports:
tidyr,
tidyselect,
zoo
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Config/testthat/edition: 3
#' Perform a z test to compare parameters from two models which were estimated with apollo
#'
#'Use this test if you estimate the exact same model with different data sets. For example, if you have a split sample and want to compare the two samples for differences in preferences. The test is especially useful for models in WTP Space where the Poe Test ist not adequate.
......@@ -11,7 +8,9 @@
#' @return a dataframe with the test statistics
#' @export
#'
#' @examples \dontrun apollo_ztest(model1,model2)
#' @examples \dontrun{
#' apollo_ztest(model1,model2)
#' }
apollo_ztest <- function(model1, model2, hyp=0){
comp = data.frame(m1par =model1[["estimate"]] ,m2par = model2[["estimate"]] , m1se=model1[["robse"]] , m2se=model2[["robse"]]) %>%
......
......@@ -20,5 +20,7 @@ a dataframe with the test statistics
Use this test if you estimate the exact same model with different data sets. For example, if you have a split sample and want to compare the two samples for differences in preferences. The test is especially useful for models in WTP Space where the Poe Test ist not adequate.
}
\examples{
\dontrun apollo_ztest(model1,model2)
\dontrun{
apollo_ztest(model1,model2)
}
}
test_that("quicktexregapollo function handles invalid model class", {
invalid_model <- list()
class(invalid_model) <- c("invalidClass")
expect_error(
quicktexregapollo(model = invalid_model, se = "rob"),
"Invalid model class. The model must be of classes 'apollo', 'maxLik', and 'maxim'."
)
})
# test_that("quicktexregapollo function handles invalid model class", {
# invalid_model <- list()
# class(invalid_model) <- c("invalidClass")
#
# expect_error(
# quicktexregapollo(model = invalid_model, se = "rob"),
# "Invalid model class. The model must be of classes 'apollo', 'maxLik', and 'maxim'."
# )
# })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment