Skip to content

Commit

Permalink
Update modMAarea.R
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrescino committed Oct 19, 2023
1 parent e401df0 commit ae7c667
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/modMAarea.R
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,18 @@ modMAarea <- function(MApopdat,
unit_totest=unit_rowest=unit_colest=unit_grpest=rowunit=totunit <- NULL
addtotal <- ifelse(rowvar == "TOTAL" || length(unique(condf[[rowvar]])) > 1, TRUE, FALSE)
estunits <- sort(unique(cdomdat[[unitvar]]))

response <- estvar.name

masemethod <- ifelse(MAmethod == "PS", "postStrat",
ifelse(MAmethod == "greg", "greg",
ifelse(MAmethod == "gregEN", "gregElasticNet",
ifelse(MAmethod == "ratio", "ratioEstimator", "horvitzThompson"))))
message("generating estimates using mase::", masemethod, " function...\n")

if (MAmethod == "greg" && modelselect == T) {

# want to do variable selection on plot level data...
pltlvl <- tdomdat[ , lapply(.SD, sum, na.rm = TRUE),
pltlvl <- cdomdat[ , lapply(.SD, sum, na.rm = TRUE),
by=c(unitvar, cuniqueid, "TOTAL", strvar, prednames),
.SDcols=response]

Expand Down

0 comments on commit ae7c667

Please sign in to comment.