Learn R Programming

umx (version 4.15.1)

umx_read_prolific_demog: Read and optionally merge demographics file from prolific academic

Description

prolific academic provides a demographics file. This reads it and merges with your data using PID and participant_id

Usage

umx_read_prolific_demog(
  file,
  base = "",
  df = NULL,
  by.df = "PROLIFIC_PID",
  by.demog = by.df,
  age = "age",
  sex = "Sex",
  vars = NULL,
  all.df = TRUE,
  all.demog = FALSE,
  verbose = FALSE
)

Value

Arguments

file

Path to a file to read.

base

Optional path to folder, in which case 'file' is just filename.

df

Existing datafile to merge demographics into (optional)

by.df

The ID name in your datafile (default = "PROLIFIC_PID" (WAS "PID")

by.demog

The ID name in the prolific demographics file (default = by.demog (WAS "participant_id")

age

Name of sex var in demographics file ("age")

sex

Name of sex var in demographics file ("Sex")

vars

Additional vars to keep from demographics file (WAS age & Sex)

all.df

Whether to keep all lines of df (default = TRUE)

all.demog

Whether to keep all lines (people) in the demographics file (default = FALSE)

verbose

Print variable names found in the file.

References

See Also

Other Data Functions: noNAs(), prolific_check_ID(), umxFactor(), umxHetCor(), umx_as_numeric(), umx_cont_2_quantiles(), umx_lower2full(), umx_make_MR_data(), umx_make_TwinData(), umx_make_fake_data(), umx_make_raw_from_cov(), umx_merge_randomized_columns(), umx_polychoric(), umx_polypairwise(), umx_polytriowise(), umx_read_lower(), umx_rename(), umx_reorder(), umx_score_scale(), umx_select_valid(), umx_stack(), umx

Examples

Run this code
if (FALSE) {
fp = "~/Desktop/prolific_export_5f20c3e662e3b6407dcd37a5.csv"
df = umx_read_prolific_demog(fp, sex = "gender", df = df)
tmp = umx_read_prolific_demog(fp, by.df = "PROLIFIC_PID", vars=c("EthnicitySimplified"))
}

Run the code above in your browser using DataLab