Skip to content

Commit

Permalink
Merge pull request #28 from Kyoshido/Kyoshido-patch-1
Browse files Browse the repository at this point in the history
Update simStructure.R
  • Loading branch information
bernhard-da committed Aug 1, 2023
2 parents 5871417 + 4e21719 commit 4b7bd5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/simStructure.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ simStructure <- function(dataS, method=c("direct", "multinom", "distribution"),
strata <- factor(rep(1, nrow(dataS@data)))
}

# Check levels for multinom method
if ( method == "multinom" & length(levels(strata)) < 2 ) {
stop("Your strata region must have 2 or more levels!\n")
}

##### set up household structure

# generate variables on household level (indicated by H)
Expand Down

0 comments on commit 4b7bd5b

Please sign in to comment.