Package 'Conversions'

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

Help Index


Create BIDS type structure

Description

Function to return the equivalent BIDS-type reference for a specific set of data.

Usage

bidsify(ID, session, site = NULL, type = "file")

Arguments

ID

CrossProject_ID

session

Subject_Timepoint

site

Site_Name

type

"file" or "folder"

Value

character in BIDS compliant format

Examples

bidsify(1100300, 2)
bidsify(1100300, 2, "ousAvanto")
bidsify(1100300, 2, "ousAvanto", type = "folder")

Calculate mean arterial pressure

Description

Calculates the mean arterial pressure based on diastolic and systolic blood pressure. MAP=(diastolic2)+systolic/3MAP = (diastolic * 2) + systolic / 3

Usage

bloodpress_map(diastolic, systolic)

Arguments

diastolic

diastolic blood pressure

systolic

systolic blood pressure

Value

numeric vector of mean arterial pressure

See Also

Other blood pressure functions: bloodpress_mean()

Examples

bloodpress_map(69, 40)

Calculate the mean blood pressure

Description

functions that given a data.frame and columns selection in argument 'cols' using tidy selectors, will calculate the mean

Usage

bloodpress_mean(data, cols, na.rm = TRUE)

Arguments

data

data frame

cols

columns selected with tidy selectors

na.rm

logical. Should missing values (including NaN) be omitted from the calculations?

Value

numeric vector with mean

See Also

Other blood pressure functions: bloodpress_map()

Examples

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"))

Calculate BMI

Description

function to calculate the BMI with the standard formulae: BMI=weight/(height/100)2BMI = weight / (height/100)^2

Usage

bmi_calc(height, weight, unit = list(height = "cm", weight = "kg"))

Arguments

height

height

weight

weight

unit

list of weight and heigt with units for the measures

Value

numeric vector of BMI

See Also

Other bmi functions: bmi_calc2()

Examples

bmi_calc(176, 72)

Calculate BMI

Description

function to calculate the BMI with the non-standard formulae: BMI=weight/(height/100)(2.5)BMI = weight / (height/100)^(2.5) which is suggested to provide a measurement that it less dependent on height.

Usage

bmi_calc2(height, weight, unit = list(height = "cm", weight = "kg"))

Arguments

height

height

weight

weight

unit

list of weight and heigt with units for the measures

Value

numeric vector of BMI

See Also

Other bmi functions: bmi_calc()

Examples

bmi_calc2(176, 72)

Convert raw IQ scores to scaled or T

Description

Will convert raw IQ scores from subtests into T or scaled values according to a conversion table

Usage

iq_raw2score(x, age, iq_table)

Arguments

x

raw iq score

age

age in decimals

iq_table

table with converions

Value

numeric vector of converted IQ scores

See Also

Other iq-functions: iq_table()

Examples

## 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)

Convert T-score to IQ

Description

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.

Usage

iq_t2iq(data, cols = NULL, iq_table = NULL)

Arguments

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

Value

numeric vector of IQ scores

Examples

## Not run: 
##

## End(Not run)

Import IQ conversion table

Description

Import a punched version of the IQ conversion table, for scaling raw scores to norm or T-scores

Usage

iq_table(table = NULL, subtest = NULL, ...)

Arguments

table

path or data.frame with conversion data

subtest

character vector indicating which subtest

...

arguments to rio::import

Value

long tibble of the wanted conversion table

See Also

Other iq-functions: iq_raw2score()

Examples

## Not run: 
conversion_table <- iq_table("tests/testthat/iq_table_subtest.tsv", header=TRUE)
iq_table(conversion_table, "vocabulary")

## End(Not run)

Adjust WPPSI components to two subtest

Description

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.

Usage

iq_wppsi_adjust(scaled1, scaled2)

Arguments

scaled1, scaled2

scaled score from subtest

Value

scaled verbal/performance iq

Examples

iq_wppsi_adjust(c(10, 14), c(14, 16))

Calculate full scale IQ from WPPSI verbal and performance IQ

Description

Calculate full scale IQ from WPPSI verbal and performance IQ

Usage

iq_wppsi_fs(verbal_iq, performance_iq)

Arguments

verbal_iq

unscaled verbal IQ

performance_iq

unscaled performance IQ

Value

vector of full scale iq

Examples

iq_wppsi_fs(89, 96)