CRAN Package Check Results for Package geex

Last updated on 2022-07-07 10:52:00 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.12 4.11 317.99 322.10 ERROR
r-devel-linux-x86_64-debian-gcc 1.0.12 4.23 222.97 227.20 ERROR
r-devel-linux-x86_64-fedora-clang 1.0.12 364.53 ERROR
r-devel-linux-x86_64-fedora-gcc 1.0.12 375.58 ERROR
r-devel-windows-x86_64 1.0.12 69.00 354.00 423.00 OK
r-patched-linux-x86_64 1.0.12 5.81 293.19 299.00 ERROR
r-release-linux-x86_64 1.0.12 3.39 292.37 295.76 ERROR
r-release-macos-arm64 1.0.12 86.00 NOTE
r-release-macos-x86_64 1.0.12 144.00 NOTE
r-release-windows-x86_64 1.0.12 68.00 362.00 430.00 OK
r-oldrel-macos-arm64 1.0.12 91.00 NOTE
r-oldrel-macos-x86_64 1.0.12 142.00 NOTE
r-oldrel-windows-ix86+x86_64 1.0.12 14.00 376.00 390.00 OK

Check Details

Version: 1.0.12
Check: package dependencies
Result: NOTE
    Package suggested but not available for checking: 'ivpack'
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
     ...
    --- re-building 'v00_geex_intro.Rmd' using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:13 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:14 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Tue Jul 5 00:20:14 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building 'v00_geex_intro.Rmd'
    
    --- re-building 'v01_additional_examples.Rmd' using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette 'v01_additional_examples.Rmd' failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building 'v01_additional_examples.Rmd'
    
    --- re-building 'v02_sandwich_comparison.Rmd' using rmarkdown
    --- finished re-building 'v02_sandwich_comparison.Rmd'
    
    --- re-building 'v03_root_solvers.Rmd' using rmarkdown
    --- finished re-building 'v03_root_solvers.Rmd'
    
    --- re-building 'v04_weights.Rmd' using rmarkdown
    --- finished re-building 'v04_weights.Rmd'
    
    --- re-building 'v05_finite_sample_corrections.Rmd' using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building 'v05_finite_sample_corrections.Rmd'
    
    --- re-building 'v06_causal_example.Rmd' using rmarkdown
    --- finished re-building 'v06_causal_example.Rmd'
    
    --- re-building 'v07_geex_design.Rmd' using rmarkdown
    --- finished re-building 'v07_geex_design.Rmd'
    
    SUMMARY: processing the following file failed:
     'v01_additional_examples.Rmd'
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘v00_geex_intro.Rmd’ using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:37 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 20:33:38 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building ‘v00_geex_intro.Rmd’
    
    --- re-building ‘v01_additional_examples.Rmd’ using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette ‘v01_additional_examples.Rmd’ failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building ‘v01_additional_examples.Rmd’
    
    --- re-building ‘v02_sandwich_comparison.Rmd’ using rmarkdown
    --- finished re-building ‘v02_sandwich_comparison.Rmd’
    
    --- re-building ‘v03_root_solvers.Rmd’ using rmarkdown
    --- finished re-building ‘v03_root_solvers.Rmd’
    
    --- re-building ‘v04_weights.Rmd’ using rmarkdown
    --- finished re-building ‘v04_weights.Rmd’
    
    --- re-building ‘v05_finite_sample_corrections.Rmd’ using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building ‘v05_finite_sample_corrections.Rmd’
    
    --- re-building ‘v06_causal_example.Rmd’ using rmarkdown
    --- finished re-building ‘v06_causal_example.Rmd’
    
    --- re-building ‘v07_geex_design.Rmd’ using rmarkdown
    --- finished re-building ‘v07_geex_design.Rmd’
    
    SUMMARY: processing the following file failed:
     ‘v01_additional_examples.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.0.12
Check: dependencies in R code
Result: NOTE
    Namespace in Imports field not imported from: ‘rootSolve’
     All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-release-macos-arm64, r-release-macos-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
    --- re-building ‘v00_geex_intro.Rmd’ using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:28 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:28 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:29 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jun 26 03:44:30 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building ‘v00_geex_intro.Rmd’
    
    --- re-building ‘v01_additional_examples.Rmd’ using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette 'v01_additional_examples.Rmd' failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building ‘v01_additional_examples.Rmd’
    
    --- re-building ‘v02_sandwich_comparison.Rmd’ using rmarkdown
    --- finished re-building ‘v02_sandwich_comparison.Rmd’
    
    --- re-building ‘v03_root_solvers.Rmd’ using rmarkdown
    --- finished re-building ‘v03_root_solvers.Rmd’
    
    --- re-building ‘v04_weights.Rmd’ using rmarkdown
    --- finished re-building ‘v04_weights.Rmd’
    
    --- re-building ‘v05_finite_sample_corrections.Rmd’ using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building ‘v05_finite_sample_corrections.Rmd’
    
    --- re-building ‘v06_causal_example.Rmd’ using rmarkdown
    --- finished re-building ‘v06_causal_example.Rmd’
    
    --- re-building ‘v07_geex_design.Rmd’ using rmarkdown
    --- finished re-building ‘v07_geex_design.Rmd’
    
    SUMMARY: processing the following file failed:
     ‘v01_additional_examples.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
    --- re-building ‘v00_geex_intro.Rmd’ using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:54 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:54 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:54 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 01:50:55 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building ‘v00_geex_intro.Rmd’
    
    --- re-building ‘v01_additional_examples.Rmd’ using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette 'v01_additional_examples.Rmd' failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building ‘v01_additional_examples.Rmd’
    
    --- re-building ‘v02_sandwich_comparison.Rmd’ using rmarkdown
    --- finished re-building ‘v02_sandwich_comparison.Rmd’
    
    --- re-building ‘v03_root_solvers.Rmd’ using rmarkdown
    --- finished re-building ‘v03_root_solvers.Rmd’
    
    --- re-building ‘v04_weights.Rmd’ using rmarkdown
    --- finished re-building ‘v04_weights.Rmd’
    
    --- re-building ‘v05_finite_sample_corrections.Rmd’ using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building ‘v05_finite_sample_corrections.Rmd’
    
    --- re-building ‘v06_causal_example.Rmd’ using rmarkdown
    --- finished re-building ‘v06_causal_example.Rmd’
    
    --- re-building ‘v07_geex_design.Rmd’ using rmarkdown
    --- finished re-building ‘v07_geex_design.Rmd’
    
    SUMMARY: processing the following file failed:
     ‘v01_additional_examples.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘v00_geex_intro.Rmd’ using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:54 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:54 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:54 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:54 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Wed Jul 6 04:07:55 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building ‘v00_geex_intro.Rmd’
    
    --- re-building ‘v01_additional_examples.Rmd’ using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette ‘v01_additional_examples.Rmd’ failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building ‘v01_additional_examples.Rmd’
    
    --- re-building ‘v02_sandwich_comparison.Rmd’ using rmarkdown
    --- finished re-building ‘v02_sandwich_comparison.Rmd’
    
    --- re-building ‘v03_root_solvers.Rmd’ using rmarkdown
    --- finished re-building ‘v03_root_solvers.Rmd’
    
    --- re-building ‘v04_weights.Rmd’ using rmarkdown
    --- finished re-building ‘v04_weights.Rmd’
    
    --- re-building ‘v05_finite_sample_corrections.Rmd’ using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building ‘v05_finite_sample_corrections.Rmd’
    
    --- re-building ‘v06_causal_example.Rmd’ using rmarkdown
    --- finished re-building ‘v06_causal_example.Rmd’
    
    --- re-building ‘v07_geex_design.Rmd’ using rmarkdown
    --- finished re-building ‘v07_geex_design.Rmd’
    
    SUMMARY: processing the following file failed:
     ‘v01_additional_examples.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-patched-linux-x86_64

Version: 1.0.12
Check: re-building of vignette outputs
Result: ERROR
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘v00_geex_intro.Rmd’ using rmarkdown
    
    Attaching package: 'geex'
    
    The following object is masked from 'package:methods':
    
     show
    
     ordinary text without R code
    
    label: SB1_estfun (with options)
    List of 2
     $ echo : logi TRUE
     $ results: chr "hide"
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB1_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB1_run (with options)
    List of 3
     $ echo : logi TRUE
     $ eval : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     library(geex)
     results <- m_estimate(
     estFUN = SB1_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1,1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB1_clsform (with options)
    List of 2
     $ echo: logi TRUE
     $ eval: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     n <- nrow(geexex)
     A <- diag(1, nrow = 2)
    
     B <- with(geexex, {
     Ybar <- mean(Y1)
     B11 <- mean( (Y1 - Ybar)^2 )
     B12 <- mean( (Y1 - Ybar) * ((Y1 - Ybar)^2 - B11) )
     B22 <- mean( ((Y1 - Ybar)^2 - B11)^2 )
     matrix(
     c(B11, B12,
     B12, B22), nrow = 2
     )
     })
    
     # closed form roots
     theta_cls <- c(mean(geexex$Y1),
     # since var() divides by n - 1, not n
     var(geexex$Y1) * (n - 1)/ n )
    
     # closed form sigma
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
    
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     757:891 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 1)
     ----------------------------------------------------------------------
    
    label: SB1_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB2_eefun (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB2_estfun <- function(data){
     Y1 <- data$Y1; Y2 <- data$Y2
     function(theta){
     c(Y1 - theta[1],
     Y2 - theta[2],
     theta[1] - (theta[3] * theta[2])
     )
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB2_run (with options)
    List of 2
     $ echo : logi TRUE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN = SB2_estfun,
     data = geexex,
     root_control = setup_root_control(start = c(1, 1, 1)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB2_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     # Comparison to an analytically derived sanwich estimator
     A <- with(geexex, {
     matrix(
     c(1 , 0, 0,
     0 , 1, 0,
     -1, mean(Y1)/mean(Y2), mean(Y2)),
     byrow = TRUE, nrow = 3)
     })
    
     B <- with(geexex, {
     matrix(
     c(var(Y1) , cov(Y1, Y2), 0,
     cov(Y1, Y2), var(Y2) , 0,
     0, 0, 0),
     byrow = TRUE, nrow = 3)
     })
    
     ## closed form roots
     theta_cls <- c(mean(geexex$Y1), mean(geexex$Y2))
     theta_cls[3] <- theta_cls[1]/theta_cls[2]
     ## closed form covariance
     Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / nrow(geexex)
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     261:346 format(max(abs(comparison$geex$estimates - comparison$cls$estimates)), digits = 2)
     438:532 format(max(abs(comparison$geex$vcov - comparison$cls$vcov)), scientific = TRUE, digits = 2)
     ----------------------------------------------------------------------
    
    label: SB2_results (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB3_eefun (with options)
    List of 3
     $ echo : logi TRUE
     $ warning: logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     SB3_estfun <- function(data){
     Y1 <- data$Y1
     function(theta){
     c(Y1 - theta[1],
     (Y1 - theta[1])^2 - theta[2],
     sqrt(theta[2]) - theta[3],
     log(theta[2]) - theta[4])
     }
     }
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB3_run (with options)
    List of 2
     $ echo : logi FALSE
     $ message: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     results <- m_estimate(
     estFUN= SB3_estfun,
     data = geexex,
     root_control = setup_root_control(start = rep(2, 4, 4, 4)))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ordinary text without R code
    
    label: SB3_clsform (with options)
    List of 1
     $ echo: logi TRUE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ## closed form roots
     theta_cls <- numeric(4)
     theta_cls[1] <- mean(geexex$Y1)
     theta_cls[2] <- sum((geexex$Y1 - theta_cls[1])^2)/nrow(geexex)
     theta_cls[3] <- sqrt(theta_cls[2])
     theta_cls[4] <- log(theta_cls[2])
    
     ## Compare to closed form ##
     theta2 <- theta_cls[2]
     mu3 <- moments::moment(geexex$Y1, order = 3, central = TRUE)
     mu4 <- moments::moment(geexex$Y1, order = 4, central = TRUE)
     ## closed form covariance
     Sigma_cls <- matrix(
     c(theta2, mu3, mu3/(2*sqrt(theta2)), mu3/theta2,
     mu3, mu4 - theta2^2, (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/theta2,
     mu3/(2 * sqrt(theta2)), (mu4 - theta2^2)/(2*sqrt(theta2)), (mu4 - theta2^2)/(4*theta2), (mu4 - theta2^2)/(2*theta2^(3/2)),
     mu3/theta2, (mu4 - theta2^2)/theta2, (mu4 - theta2^2)/(2*theta2^(3/2)), (mu4/theta2^2) - 1) ,
     nrow = 4, byrow = TRUE) / nrow(geexex)
     ## closed form covariance
     # Sigma_cls <- (solve(A) %*% B %*% t(solve(A))) / n
     comparison <- list(geex = list(estimates = coef(results), vcov = vcov(results)),
     cls = list(estimates = theta_cls, vcov = Sigma_cls))
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:10 2022 ------##
    
     ---------------------- inline R code fragments -----------------------
     234:368 format(max(abs(comparison$geex$estimates - comparison$cls$estimates), abs(comparison$geex$vcov - comparison$cls$vcov)), digits = 2)
     ----------------------------------------------------------------------
    
    label: SB3_results (with options)
    List of 1
     $ echo: logi FALSE
    
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ R code chunk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     comparison
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ##------ Sun Jul 3 19:44:11 2022 ------##
    
     ordinary text without R code
    
    --- finished re-building ‘v00_geex_intro.Rmd’
    
    --- re-building ‘v01_additional_examples.Rmd’ using rmarkdown
    Quitting from lines 105-107 (v01_additional_examples.Rmd)
    Error: processing vignette ‘v01_additional_examples.Rmd’ failed with diagnostics:
    there is no package called 'ivpack'
    --- failed re-building ‘v01_additional_examples.Rmd’
    
    --- re-building ‘v02_sandwich_comparison.Rmd’ using rmarkdown
    --- finished re-building ‘v02_sandwich_comparison.Rmd’
    
    --- re-building ‘v03_root_solvers.Rmd’ using rmarkdown
    --- finished re-building ‘v03_root_solvers.Rmd’
    
    --- re-building ‘v04_weights.Rmd’ using rmarkdown
    --- finished re-building ‘v04_weights.Rmd’
    
    --- re-building ‘v05_finite_sample_corrections.Rmd’ using rmarkdown
    Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
    running glm to get initial regression estimate
    --- finished re-building ‘v05_finite_sample_corrections.Rmd’
    
    --- re-building ‘v06_causal_example.Rmd’ using rmarkdown
    --- finished re-building ‘v06_causal_example.Rmd’
    
    --- re-building ‘v07_geex_design.Rmd’ using rmarkdown
    --- finished re-building ‘v07_geex_design.Rmd’
    
    SUMMARY: processing the following file failed:
     ‘v01_additional_examples.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-release-linux-x86_64