start_new_project_from_oplm: Start a new project from oplm files

View source: R/oplike.R

start_new_project_from_oplmR Documentation

Start a new project from oplm files

Description

Creates a dexter project database and fills it with response data based on a .dat and .scr file

Usage

start_new_project_from_oplm(
  dbname,
  scr_path,
  dat_path,
  booklet_position = NULL,
  responses_start = NULL,
  response_length = 1,
  person_id = NULL,
  missing_character = c(" ", "9"),
  use_discrim = FALSE,
  format = "compressed"
)

Arguments

dbname

filename/path of new dexter project database (will be overwritten if already exists)

scr_path

path to the .scr file

dat_path

path to the .dat file

booklet_position

vector of start and end of booklet position in the dat file, e.g. c(1,4), all positions are counted from 1, start and end are both inclusive. If NULL, this is read from the scr file.

responses_start

start position of responses in the .dat file. If NULL, this is read from the scr file.

response_length

length of individual responses, default=1

person_id

optionally, a vector of start and end position of person_id in the .dat file. If NULL, person id's will be auto-generated.

missing_character

vector of character(s) used to indicate missing in .dat file, default is to use both a space and a 9 as missing characters.

use_discrim

if TRUE, the scores for the responses will be multiplied by the discrimination parameters of the items

format

not used, at the moment only the compressed format is supported.

Details

start_new_project_from_oplm builds a complete dexter database from a .dat and .scr file in the proprietary oplm format. Four custom variables are added to the database: booklet_on_off, oplm_marginal, item_local_on_off, item_global_on_off. These are taken from the .scr file and can be used in predicates in the various dexter functions.

Booklet_position and responses_start are usually inferred from the scr file but since they are sometimes misspecified in the scr file they can be overridden. Response_length is not inferred from the scr file since anything other than 1 is most often a mistake.

Value

a database connection object.

Examples

## Not run: \donttest{
db = start_new_project_from_oplm('test.db',
   'path_to_scr_file', 'path_to_dat_file', 
   booklet_position=c(1,3), responses_start=101,
   person_id=c(50,62))

prms = fit_enorm(db, 
   item_global_on_off==1 & item_local_on_off==1 & booklet_on_off==1)


}
## End(Not run)

dexter documentation built on May 25, 2022, 9:10 a.m.