Title: | Collection of functions that convert certain RAW data in the LCBC database |
---|---|
Description: | Collection of functions that convert certain RAW data in the LCBC database. |
Authors: | Athanasia Monika Mowinckel [aut, cre] |
Maintainer: | Athanasia Monika Mowinckel <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-10-26 03:25:06 UTC |
Source: | https://github.com/LCBC-UiO/Conversions |
Function to return the equivalent BIDS-type reference for a specific set of data.
bidsify(ID, session, site = NULL, type = "file")
bidsify(ID, session, site = NULL, type = "file")
ID |
CrossProject_ID |
session |
Subject_Timepoint |
site |
Site_Name |
type |
"file" or "folder" |
character in BIDS compliant format
bidsify(1100300, 2) bidsify(1100300, 2, "ousAvanto") bidsify(1100300, 2, "ousAvanto", type = "folder")
bidsify(1100300, 2) bidsify(1100300, 2, "ousAvanto") bidsify(1100300, 2, "ousAvanto", type = "folder")
Calculates the mean arterial pressure
based on diastolic and systolic blood pressure.
bloodpress_map(diastolic, systolic)
bloodpress_map(diastolic, systolic)
diastolic |
diastolic blood pressure |
systolic |
systolic blood pressure |
numeric vector of mean arterial pressure
Other blood pressure functions:
bloodpress_mean()
bloodpress_map(69, 40)
bloodpress_map(69, 40)
functions that given a data.frame and columns selection in argument 'cols' using tidy selectors, will calculate the mean
bloodpress_mean(data, cols, na.rm = TRUE)
bloodpress_mean(data, cols, na.rm = TRUE)
data |
data frame |
cols |
columns selected with tidy selectors |
na.rm |
logical. Should missing values (including NaN) be omitted from the calculations? |
numeric vector with mean
Other blood pressure functions:
bloodpress_map()
dt <- data.frame( BloodPress_Diastolic_1 = c(80,32,66,NA), BloodPress_Diastolic_2 = c(58,45,NA,99), BloodPress_Systolic_1 = c(40,NA,80,120), BloodPress_Systolic_2 = c(NA, 65,45,100) ) bloodpress_mean(dt, dplyr::contains("Diastolic")) bloodpress_mean(dt, dplyr::contains("Systolic"))
dt <- data.frame( BloodPress_Diastolic_1 = c(80,32,66,NA), BloodPress_Diastolic_2 = c(58,45,NA,99), BloodPress_Systolic_1 = c(40,NA,80,120), BloodPress_Systolic_2 = c(NA, 65,45,100) ) bloodpress_mean(dt, dplyr::contains("Diastolic")) bloodpress_mean(dt, dplyr::contains("Systolic"))
function to calculate the BMI
with the standard formulae:
bmi_calc(height, weight, unit = list(height = "cm", weight = "kg"))
bmi_calc(height, weight, unit = list(height = "cm", weight = "kg"))
height |
height |
weight |
weight |
unit |
list of weight and heigt with units for the measures |
numeric vector of BMI
Other bmi functions:
bmi_calc2()
bmi_calc(176, 72)
bmi_calc(176, 72)
function to calculate the BMI with the non-standard formulae: which is suggested to provide a measurement that
it less dependent on height.
bmi_calc2(height, weight, unit = list(height = "cm", weight = "kg"))
bmi_calc2(height, weight, unit = list(height = "cm", weight = "kg"))
height |
height |
weight |
weight |
unit |
list of weight and heigt with units for the measures |
numeric vector of BMI
Other bmi functions:
bmi_calc()
bmi_calc2(176, 72)
bmi_calc2(176, 72)
Will convert raw IQ scores from subtests into T or scaled values according to a conversion table
iq_raw2score(x, age, iq_table)
iq_raw2score(x, age, iq_table)
x |
raw iq score |
age |
age in decimals |
iq_table |
table with converions |
numeric vector of converted IQ scores
Other iq-functions:
iq_table()
## Not run: t <- iq_table(".iq_table_subtest.tsv", "Vocab", header=TRUE) iq_raw2score(31, 22, t) iq_raw2score(x = c(33, 34, NA, 34), age=c(15.5, 20, 20, NA)) ## End(Not run)
## Not run: t <- iq_table(".iq_table_subtest.tsv", "Vocab", header=TRUE) iq_raw2score(31, 22, t) iq_raw2score(x = c(33, 34, NA, 34), age=c(15.5, 20, 20, NA)) ## End(Not run)
This function converts iq T-scores
to IQ, using the conversion table provided.
The conversion table provided, and the columns
in the data selected through the 'cols' argument
must correspond regarding the test battery used,
and the number of subtests provided for the IQ.
If providing 2 WASI subtests scores, the conversion
table must be for the conversion of two subtests
to fullscale IQ. For WPPSI, you must select
columns with verbal and performance IQ scaled
to calculate the unscaled verbal and performane IQ.
For WPPSI fullscale IQ, apply the iq_wppsi_fs
function, using the two unscaled verbal and
performance IQs.
iq_t2iq(data, cols = NULL, iq_table = NULL)
iq_t2iq(data, cols = NULL, iq_table = NULL)
data |
data.frame |
cols |
columns in the data frame with necessary data |
iq_table |
table with conversion, first column being the score to convert from, second score to convert to |
numeric vector of IQ scores
## Not run: ## ## End(Not run)
## Not run: ## ## End(Not run)
Import a punched version of the IQ conversion table, for scaling raw scores to norm or T-scores
iq_table(table = NULL, subtest = NULL, ...)
iq_table(table = NULL, subtest = NULL, ...)
table |
path or data.frame with conversion data |
subtest |
character vector indicating which subtest |
... |
arguments to |
long tibble of the wanted conversion table
Other iq-functions:
iq_raw2score()
## Not run: conversion_table <- iq_table("tests/testthat/iq_table_subtest.tsv", header=TRUE) iq_table(conversion_table, "vocabulary") ## End(Not run)
## Not run: conversion_table <- iq_table("tests/testthat/iq_table_subtest.tsv", header=TRUE) iq_table(conversion_table, "vocabulary") ## End(Not run)
WPPSI requires 3 or more subtests for verbal and performance IQ. There is an adjustment that may be made for it to approximate using two subtests. This function applies this adjustment.
iq_wppsi_adjust(scaled1, scaled2)
iq_wppsi_adjust(scaled1, scaled2)
scaled1 , scaled2
|
scaled score from subtest |
scaled verbal/performance iq
iq_wppsi_adjust(c(10, 14), c(14, 16))
iq_wppsi_adjust(c(10, 14), c(14, 16))
Calculate full scale IQ from WPPSI verbal and performance IQ
iq_wppsi_fs(verbal_iq, performance_iq)
iq_wppsi_fs(verbal_iq, performance_iq)
verbal_iq |
unscaled verbal IQ |
performance_iq |
unscaled performance IQ |
vector of full scale iq
iq_wppsi_fs(89, 96)
iq_wppsi_fs(89, 96)