Comments (5)
Thank you @LucyMcGowan for the report and the simple reprex (much appreciated!).
The warning appears from using the deff=TRUE
argument.
library(survey, warn.conflicts = FALSE)
#> Loading required package: grid
#> Loading required package: Matrix
#> Loading required package: survival
d <- mtcars[, 1, drop = FALSE]
d$weight <- runif(nrow(mtcars), 0, 0.5)
des <- svydesign(~1, weights = ~weight, data = d)
svymean(~mpg, des, na.rm = TRUE, deff = TRUE)
#> Warning in svymean.survey.design2(~mpg, des, na.rm = TRUE, deff = TRUE): Sample
#> size greater than population size: are weights correctly scaled?
#> mean SE DEff
#> mpg 20.3106 1.1444 NA
Created on 2023-11-28 with reprex v2.0.2
@larmarange the line in question is coming from here:
Line 361 in 30ef717
I don't know why/if this is needed. Can you chime in, please?
from gtsummary.
Ah! I was trying to fiddle with it and somehow missed that option β estimating the Design Effect definitely doesnβt make sense from a propensity score weighting perspective but not sure how that is used internally
from gtsummary.
@LucyMcGowan The design effect is only used to estimate the proportion of missing data and not in the primary mean calculation. @larmarange can comment on these differences with more authority than I can!
As an aside: we're planning a rather large refactor, and if there are pain points or suggestions, please feel free to voice them here!
from gtsummary.
Hi, following #1486, we have added design effects to the list of statistics available in tbl_svysummary()
.
Due to the design of the functions, inherited from tbl_summary()
, summarize_continuous_survey()
computes deff only on demand, while summarize_categorical_survey()
always computes all the possible statistics.
To be noted, even for a continuous variable, summarize_categorical_survey()
is called to calculate the number of observations.
Line 650 in 30ef717
We probably need to update summarize_categorical_survey()
to compute deff only when required.
from gtsummary.
Thanks @larmarange !
FYI @LucyMcGowan in the next version of the package, the messaging will be more clear where any warnings come from, for example it will say that this warning comes from estimating the statistic to measure the proportion of missing data.
from gtsummary.
Related Issues (20)
- v2.0 `inline_text()`
- v2.0 style functions
- v2.0 print engines
- v2.0 select helpers
- v2.0 Custom Tidiers
- v2.0 `tbl_likert()` ?
- v2.0 vignettes and articles
- Questioning `add_stat_label()`
- Add `modify_table_styling()` checks?
- Question / Feature request: type "dichotomous" option in tbl_summary not displaying both levels HOT 3
- v2.0 `modify_footnote()` updates HOT 1
- v2.0 README
- Wording in `tbl_uregression()` documentation: univariable instead of univariate? HOT 2
- Compatibility with VGAM HOT 3
- Improve `style_number()` speed?
- Feature request: Informative caption when using `tbl_regression()` with `mice::mira` HOT 2
- v2.0 Add arguments `style_*(prefix, suffix)` ?
- Feature request: Automated suppression of small counts HOT 1
- v2.0 `tbl_stack()`, `tbl_merge()`, `tbl_strata()`, etc.
- `show_header_names()` updates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtsummary.