myee <- function(data){
function(theta){
c(data$Y1 - theta[1],
(data$Y1 - theta[1])^2 - theta[2])
}
}
# Start with a basic basis
mybasis <- create_basis(
estFUN = myee,
data = geexex)
# Now estimate sandwich matrices
estimate_sandwich_matrices(
mybasis, c(mean(geexex$Y1), var(geexex$Y1)))
Run the code above in your browser using DataLab