strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

object ‘rescale_weights’ is not exported by 'namespace:parameters' #107

Closed IndrajeetPatil closed 3 years ago

IndrajeetPatil commented 3 years ago

The following example in datawizard is broken with the said error and just wanted to make sure that sjstats update will be fixing it: https://easystats.github.io/datawizard/reference/rescale_weights.html

if (require("sjstats")) {
  data(nhanes_sample, package = "sjstats")
  head(rescale_weights(nhanes_sample, "SDMVSTRA", "WTINT2YR"))

  # also works with multiple group-variables...
  head(rescale_weights(nhanes_sample, c("SDMVSTRA", "SDMVPSU"), "WTINT2YR"))

  # or nested structures.
  x <- rescale_weights(
    data = nhanes_sample,
    group = c("SDMVSTRA", "SDMVPSU"),
    probability_weights = "WTINT2YR",
    nest = TRUE
  )
  head(x)
}
#> Loading required package: sjstats
#> Error: package or namespace load failed for ‘sjstats’:
#>  object ‘rescale_weights’ is not exported by 'namespace:parameters'

if (require("lme4") && require("sjstats")) {
  data(nhanes_sample, package = "sjstats")
  nhanes_sample <- rescale_weights(nhanes_sample, "SDMVSTRA", "WTINT2YR")
  glmer(
    total ~ factor(RIAGENDR) * (log(age) + factor(RIDRETH1)) + (1 | SDMVPSU),
    family = poisson(),
    data = nhanes_sample,
    weights = pweights_a
  )
}
#> Loading required package: lme4
#> Loading required package: Matrix
#> Loading required package: sjstats
#> Error: package or namespace load failed for ‘sjstats’:
#>  object ‘rescale_weights’ is not exported by 'namespace:parameters'