diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..1def62c --- /dev/null +++ b/docs/404.html @@ -0,0 +1,96 @@ + + +
+ + + + +The gsedscripts repository contains script to read, process, model, summarise and plot data collected within the Global Scales of Early Development project of the World Health Organisation (WHO).
+This study was supported by the Bill & Melinda Gates Foundation. The contents are the sole responsibility of the authors and may not necessarily represent the official views of the Bill & Melinda Gates Foundation or other agencies that may have supported the primary data studies used in the present study.
+scripts/models/293_0.R
to use DIF tabulation function and explore Yen’s Q3 method for exploring dimensionalityscripts/models/lf_155_0.R
to feature newer functions and to compact codescripts/DIF_demo_2groups.R
to shows how to use the difR
package in the SMOCC data for testing 2-group DIF with MH and logistic regression methodscalculate_DIF_table()
for testing DIFmake_wide()
to provide more records for analysisupdate_required_packages()
to automate modelling scriptsupdate_required_packages()
to automate modelling scriptscalculate_administrative()
for deriving standard administrative variablesmake_wide()
to combine SF, LF and BSID data from the first observation period onto one record per childinst/scripts/compare_domain_taus_293.R
to inspect the overlap between three streams of the LF a as way to informally inspect the uni-dimensionality of the LF. Used for the July 2024 version of the phase1 paper.inst/scripts/extract_equate_table.R
to extract the equate table to compare keys gsed1912
and gsed2406
. Used for the July 2024 version of the phase1 paper.Rmd/20240802_logit.Rmd
to demonstrate that logit and D-score scales are consistent for LF and SF, but not for other instrumentsinst/script/models/by3_extension.R
to link BSID-III under fixing SF/LF tau estimates to those in model 293_0, leading to consistent logit and D-score scale for BSID-IIIinst/scripts/counts.R
and inst/scripts/293_0.R
that takes only the first LF, SF and BSID before matching. As a result, each row corresponds to a unique subjid (child). This does not use all data, but is much easier to explain and report. The impact of the method on the item difficulty estimates is negligible (r > 0.99).inst/scripts/fit_phase1_healthy_references.R
to calculate new healthy references for the GSED keyinst/scripts/fit_phase1_dutch_references.R
+inst/scripts/fit_models.R
a refit using dscore 1.8.8
+inst/scripts/compare_algorithm.R
to compare models “20221201_remodel/293_0” and “20240601/293_0” using dscore 1.8.8
+inst/scripts/compare_models.R
to compare models “20221201_remodel/293_0” and “20240601/293_0” using the dscore 1.8.8
+inst/scripts/fit_phase1_references.R
with calculation of the healthy subsample references from the GSED keyinst/scripts/fit_phase1_references.R
with calculation of the Dutch references from the GSED keyassemble_data.R
and edit_data.R
+calculate_DIF_table.Rd
This function calculates DIF statistics for multiple groups using the +`difR` package. The function uses the `difGenLogistic()` function for +generalized logistic regression and the `difGMH()` function for the +generalized Mantel-Haenszel test. The function returns a table with +DIF statistics per item.
+calculate_DIF_table(data, items, score, group, levels = NULL, thr = NULL)
Data frame with dichotomous item responses and age
Character vector with item names
Data frame with item parameters
Factor or character vector with group names. Must have same +length as the number of rows in the data frame.
Optional. Character vector with group names. If omitted, the function +will use the unique values of the group variable.
Optional. Threshold for DIF classification using the MH-statistics. +If omitted, the function will use the threshold from the `difGMH()` function.
data frame with DIF statistics per item
+The function uses the `"holm"` method for p-value adjustment.
+library(dscore)
+data <- dscore::milestones
+score <- dscore(data = data, xname = "age", metric = "logit")[["d"]]
+items <- intersect(get_itemnames(ins = "ddi", order = "indm"), colnames(data))
+
+calculate_DIF_table(data = data, items = items, group = data$sex, score = score)
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Warning: glm.fit: algorithm did not converge
+#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
+#> Error in n.ppk * diag(rk) - rk %*% t(rk): non-conformable arrays
+
+ All functions+ + |
+ |
---|---|
+ + | +Calculate DIF statistic per item for multiple groups |
+
+ + | +Calculate administrative variables |
+
+ + | +Merge measurement made on different days to one child level record |
+
+ + | +Require a package |
+
+ + | +Update the required packages to their development versions |
+
make_wide.Rd
For a given child, this script joins measurements made within a +specified window.
+make_wide(
+ long,
+ instruments = c("gpa", "gto", "by3"),
+ days = 10L,
+ drop_na_age = TRUE,
+ include_return = FALSE,
+ quiet = FALSE
+)
Long form data, typically created by scripts/edit_data.R
Character vector of instruments names. Currently supported +instruments are `"gpa"`, `"gto"` and `"by3"`.
Non-negative integer, window width in number of days
Logical. Should measurements with missing ages be dropped?
Logical. Should the return visits be included in the join?
Logical. Print messages to terminal?
A data frame with one record per child. The first five columns +are administrative variables, followed by the intervals in days per +instrument. The remaining columns are items from the instruments.
+if (FALSE) { # \dontrun{
+joined <- make_wide(long, instruments = c("gpa", "gto"))
+} # }
+
require_package.Rd
Check whether a package is installed. If not, the +procedure offers to install the latest version from CRAN or GitHub. +Then it check for a minimum version.
+require_package(pkg, version, repo = "CRAN")
A logical indicating success (TRUE) or failure (FALSE) for version check.
+update_required_packages.Rd
This function checks if the required packages are installed and up-to-date. +If not, it asks the user if they want to install the development versions +from GitHub.
+update_required_packages(allow_update = FALSE, include_gseddata = FALSE)
Logical. `TRUE` if all required packages are installed and up-to-date.
+