| Type: | Package | 
| Title: | Linking Patient-Reported Outcomes Measures | 
| Version: | 0.4.2 | 
| Description: | Perform scale linking to establish relationships between instruments that measure similar constructs according to the PROsetta Stone methodology, as in Choi, Schalet, Cook, & Cella (2014) <doi:10.1037/a0035768>. | 
| URL: | https://www.prosettastone.org/ (project description), https://choi-phd.github.io/PROsetta/ (documentation) | 
| BugReports: | https://github.com/choi-phd/PROsetta/issues | 
| Imports: | Rcpp (≥ 1.0.0), equate, lavaan, mirt, plink, psych, methods, mvnfast, TestDesign (≥ 1.5.1) | 
| SystemRequirements: | C++17 | 
| Depends: | R (≥ 3.5.0) | 
| Suggests: | shiny, shinythemes, shinyWidgets, shinyjs, DT, knitr, kableExtra, testthat (≥ 2.1.0), rmarkdown, dplyr, pkgdown | 
| LinkingTo: | Rcpp, RcppArmadillo | 
| License: | GPL-3 | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 7.3.2 | 
| VignetteBuilder: | knitr | 
| Config/testthat/edition: | 3 | 
| Collate: | 'RcppExports.R' 'import.R' 'loading_functions.R' 'post_functions.R' 'core_functions.R' 'datasets.R' 'example.R' 'helper_functions.R' 'linking_functions.R' 'parameterization_functions.R' 'plot_functions.R' 'preanalysis_functions.r' 'runshiny.R' | 
| NeedsCompilation: | yes | 
| Packaged: | 2025-08-18 12:42:03 UTC; chois1 | 
| Author: | Seung W. Choi | 
| Maintainer: | Seung W. Choi <schoi@austin.utexas.edu> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-08-18 13:50:08 UTC | 
PROsetta
Description
PROsetta is a caller function for launching a Shiny app locally.
Usage
PROsetta()
Examples
if (interactive()) {
  PROsetta()
}
Check frequency table for unobserved response categories
Description
checkFrequency is a descriptive function for checking whether all response categories in a frequency table have a frequency of at least 1.
Usage
checkFrequency(data)
Arguments
| data | a  | 
Value
checkFrequency returns TRUE if all response categories have a frequency of at least 1, and FALSE if not.
Examples
checkFrequency(data_asq) # TRUE
## Not run: 
data_asq@response$EDANX01[data_asq@response$EDANX01 == 4] <- 3
checkFrequency(data_asq) # FALSE
## End(Not run)
Compare two sets of scores
Description
compareScores is a helper function for comparing two sets of scores.
Usage
compareScores(left, right, type = c("corr", "mean", "sd", "rmsd", "mad"))
Arguments
| left | scores on the left side of comparison. | 
| right | scores on the right side of comparison. This is subtracted from 'left'. | 
| type | type of comparisons to include. Accepts  | 
Value
compareScores returns a data.frame containing the comparison results.
Examples
set.seed(1)
true_theta <- rnorm(100)
theta_est <- true_theta + rnorm(100, 0, 0.3)
compareScores(theta_est, true_theta)
(internal) compute response probability
Description
computeResponseProbability is an internal function for computing response probability from a set of item parameters.
Usage
computeResponseProbability(ipar, model_id, theta_grid)
Arguments
| ipar | a  | 
| model_id | the column name for item models. | 
| theta_grid | theta values to compute probability values at. | 
Value
computeResponseProbability returns an item-wise list of probability matrices.
Examples
ipar <- PROsetta:::extractAnchorParameters(data_asq, as = "AB")
theta_q <- seq(-4, 4, .1)
p <- PROsetta:::computeResponseProbability(ipar, "item_model", theta_q)
plot(
  0, 0, type = "n", xlim = c(-4, 4), ylim = c(0, 1),
  xlab = "Theta", ylab = "Response probability"
)
lines(theta_q, p[[1]][, 1])
lines(theta_q, p[[1]][, 2])
lines(theta_q, p[[1]][, 3])
lines(theta_q, p[[1]][, 4])
lines(theta_q, p[[1]][, 5])
ASQ dataset
Description
This dataset is associated with the following objects:
Details
-  response_asqadata.framecontaining raw response data of 751 participants and 41 variables.-  prosettaidparticipant IDs.
-  EDANX01 -- MASQ11response to items.
 
-  
-  itemmap_asqadata.framecontaining the item map, describing the items in each instrument.-  item_orderitem numeric IDs. This column refers to the columnitem_orderin anchor item attributes.
-  instrumentthe instrument ID that each item belongs to.
-  item_iditem ID strings. This column refers to column names in raw response data, excluding the participant ID column.
-  item_namenew item ID strings to be used in the combined scale.
-  ncatthe number of response categories.
 
-  
-  anchor_asqadata.framecontaining anchor item parameters for 29 items.-  item_orderitem numeric IDs.
-  item_iditem ID strings. This column refers to column names in raw response data, excluding the participant ID column.
-  athe discrimination (slope) parameter for the graded response model.
-  cb1 - cb4the boundaries between each category-pair for the graded response model.
 
-  
-  data_asqaPROsetta_dataobject containing the datasets above. SeeloadDatafor creatingPROsetta_dataobjects.
Examples
## load datasets into a PROsetta_data object
data_asq <- loadData(
  response = response_asq,
  itemmap  = itemmap_asq,
  anchor   = anchor_asq
)
## run descriptive statistics
runDescriptive(data_asq)
## run item parameter calibration on the response data, linking to the anchor item parameters
runLinking(data_asq, method = "FIXEDPAR")
DEP dataset
Description
This dataset is associated with the following objects:
Details
-  response_depadata.framecontaining raw response data of 747 participants and 49 variables.-  prosettaidparticipant IDs.
-  EDDEP04 -- CESD20response to items.
 
-  
-  itemmap_depadata.framecontaining the item map, describing the items in each instrument.-  item_orderitem numeric IDs. This column refers to the columnitem_orderin anchor item parameters.
-  instrumentthe instrument ID that each item belongs to.
-  item_iditem ID strings. This column refers to column names in raw response data, excluding the participant ID column.
-  item_namenew item ID strings to be used in the combined scale.
-  ncatthe number of response categories.
 
-  
-  anchor_depadata.framecontaining anchor item parameters for 28 items.-  item_orderitem numeric IDs.
-  item_iditem ID strings. This column refers to column names in raw response data, excluding the participant ID column.
-  athe discrimination (slope) parameter for the graded response model.
-  cb1 - cb4the boundaries between each category-pair for the graded response model.
 
-  
-  data_depaPROsetta_dataobject containing the datasets above. SeeloadDatafor creatingPROsetta_dataobjects.
Examples
## load datasets into a PROsetta_data object
data_dep <- loadData(
  response = response_dep,
  itemmap  = itemmap_dep,
  anchor   = anchor_dep
)
## run descriptive statistics
runDescriptive(data_dep)
## run item parameter calibration on the response data, linking to the anchor item parameters
runLinking(data_dep, method = "FIXEDPAR")
(internal) detect parameterization type
Description
detectParameterization is an internal function for detecting the type of parameterization used in a set of item parameters.
detectParameterization is an internal function for detecting the type of parameterization used in a set of item parameters.
Usage
detectParameterization(ipar)
detectParameterization(ipar)
Arguments
| ipar | a  | 
Value
detectParameterization returns ab or ad.
detectParameterization returns ab or ad.
Examples
PROsetta:::detectParameterization(data_asq@anchor) # ab
PROsetta:::detectParameterization(data_asq@anchor) # ab
Get complete data
Description
getCompleteData is a helper function for performing casewise deletion of missing values.
Usage
getCompleteData(data, scale = NULL, verbose = FALSE)
Arguments
| data | a  | 
| scale | the index of the scale to perform casewise deletion. Leave empty or set to "combined" to perform on all scales. | 
| verbose | if  | 
Value
getCompleteData returns an updated PROsetta_data object.
Examples
d <- getCompleteData(data_asq, verbose = TRUE)
Calculate expected scores at theta
Description
getEscore is a helper function for obtaining expected scores at supplied thetas.
Usage
getEscore(ipar, model, theta, is_minscore_0)
Arguments
| ipar | item parameters. | 
| model | item model to use. | 
| theta | theta values. | 
| is_minscore_0 | if  | 
Value
getEscore returns a vector of expected scores.
Get item names
Description
getItemNames is a helper function for extracting item names for a specified scale from a PROsetta_data object.
Usage
getItemNames(d, scale_id)
Arguments
| d | a  | 
| scale_id | scale IDs to extract item names. | 
Value
getItemNames returns a vector containing item names.
Examples
getItemNames(data_asq, 1)
getItemNames(data_asq, 2)
getItemNames(data_asq, c(1, 2))
getItemNames(data_asq, c(2, 1))
Compute a Crosswalk Table
Description
getRSSS is a function for generating a raw-score to standard-score crosswalk table.
Usage
getRSSS(ipar, model_id, theta_grid, is_minscore_0, prior_mu_sigma)
Arguments
| ipar | an item parameter matrix for graded response items. Accepts both a/b and a/d format parameters. Accepts multidimensional item parameters. | 
| model_id | the column name for item models. | 
| theta_grid | the theta grid to use for numerical integration. | 
| is_minscore_0 | if  | 
| prior_mu_sigma | a named list containing prior distribution parameters. All values must be in the theta metric. 
 | 
Examples
## Free calibration without using anchor
o <- runCalibration(data_asq, technical = list(NCYCLES = 1000))
ipar <- mirt::coef(o, IRTpars = TRUE, simplify = TRUE)$items
ipar <- as.data.frame(ipar)
ipar[, data_asq@model_id] <- data_asq@itemmap[, data_asq@model_id]
items <- getItemNames(data_asq, 2)
getRSSS(
  ipar = ipar[items, ],
  model_id = data_asq@model_id,
  theta_grid = seq(-4, 4, .1),
  is_minscore_0 = TRUE,
  prior_mu_sigma = list(mu = 0, sigma = 1)
)
Extract scale-wise response
Description
getResponse is a helper function for extracting scale-wise response from a PROsetta_data object.
Usage
getResponse(d, scale_id = "all", person_id = FALSE)
Arguments
| d | a  | 
| scale_id | scale IDs to extract response. If  | 
| person_id | if  | 
Value
getResponse returns a data.frame containing scale-wise response.
Examples
getResponse(data_asq)
getResponse(data_asq, 1)
getResponse(data_asq, 2)
getResponse(data_asq, c(1, 2))
getResponse(data_asq, c(2, 1))
getResponse(data_asq, c(1, 2), person_id = TRUE)
Calculate raw sum scores of a scale
Description
getScaleSum is a helper function for calculating instrument-wise raw sum scores from response data.
Usage
getScaleSum(data, scale_idx)
Arguments
| data | a  | 
| scale_idx | the instrument index to obtain the raw sum scores. | 
Examples
getScaleSum(data_asq, 1)
getScaleSum(data_asq, 2)
Obtain theta estimates
Description
getTheta is a helper function for obtaining theta estimates.
Estimates are obtained using an expected a posteriori (EAP) method.
Usage
getTheta(
  data,
  ipar,
  scale = "combined",
  theta_grid = seq(-4, 4, 0.1),
  prior_dist = "normal",
  prior_mean = 0,
  prior_sd = 1
)
Arguments
| data | a  | 
| ipar | a  | 
| scale | the index of the scale to use.  | 
| theta_grid | the theta grid to use for numerical integration. (default =  | 
| prior_dist | the type of prior distribution. Accepts  | 
| prior_mean | mean of the prior distribution. (default =  | 
| prior_sd | SD of the prior distribution. (default =  | 
Value
getTheta returns a list containing EAP estimates.
Examples
x <- runLinking(data_asq, method = "FIXEDPAR")
o <- getTheta(data_asq, x$ipar_linked, scale = 1)
o$theta
o$item_idx
o <- getTheta(data_asq, x$ipar_linked, scale = 2)
o$theta
o$item_idx
o <- getTheta(data_asq, x$ipar_linked, scale = "combined")
o$theta
o$item_idx
Load data from supplied config
Description
loadData is a data loading function for creating a PROsetta_data object, for performing scale linking/equating in the 'PROsetta' package.
loadData assumes the response data has been reverse-coded for applicable items.
Usage
loadData(
  response,
  itemmap,
  anchor,
  item_id = NULL,
  person_id = NULL,
  scale_id = NULL,
  model_id = NULL,
  input_dir = getwd()
)
Arguments
| response | response data containing case IDs and item responses. This can be a  | 
| itemmap | an item map containing item IDs and scale IDs. This can be a  | 
| anchor | anchor data containing item parameters for anchor items. This can be a  | 
| item_id | the column name to look for item IDs. Automatically determined if not specified. | 
| person_id | the column name to look for case IDs. Automatically determined if not specified. | 
| scale_id | the column name to look for scale IDs. Automatically determined if not specified. | 
| model_id | the column name to look for model IDs. Automatically determined if not specified. | 
| input_dir | the directory to look for the files. | 
Value
loadData returns a PROsetta_data object containing the loaded data.
(internal) construct a model
Description
makeCalibrationModel is an internal function for constructing a model.
Usage
makeCalibrationModel(d, dimensions, bound_cov)
Arguments
| d | a  | 
| dimensions | the number of dimensions to use in the model. Must be  | 
| bound_cov | only used when  | 
Value
makeCalibrationModel returns a mirt.model object.
Examples
PROsetta:::makeCalibrationModel(data_asq, 1, FALSE)
PROsetta:::makeCalibrationModel(data_asq, 1, TRUE)
PROsetta:::makeCalibrationModel(data_asq, 2, FALSE)
PROsetta:::makeCalibrationModel(data_asq, 2, TRUE)
Plot frequency distribution
Description
This is an extension of plot to visualize frequency distribution from PROsetta_data object.
Usage
## S4 method for signature 'PROsetta_data,ANY'
plot(
  x,
  y,
  scale_id = "combined",
  filename = NULL,
  title = NULL,
  xlim = NULL,
  color = "blue",
  nbar = 20,
  rug = FALSE,
  filetype = "pdf",
  savefile = FALSE,
  bg = "white",
  width = 6,
  height = 6,
  pointsize = 12
)
Arguments
| x | a  | 
| y | unused argument, exists for compatibility with  | 
| scale_id | scale ID to plot.  | 
| filename | the filename to write if  | 
| title | the title of the figure. | 
| xlim | the range of scores to plot. | 
| color | the color to fill the histogram. (default =  | 
| nbar | the number of histogram bars. (default =  | 
| rug | if  | 
| filetype | the type of file to write if  | 
| savefile | if  | 
| bg | the background color to use when saving the figure as a file. (default =  | 
| width | the width of the plot. (default =  | 
| height | the height of the plot. (default =  | 
| pointsize | the point size to use when saving the figure as a file. (default =  | 
Examples
plot(data_asq)
plot(data_asq, scale_id = 1)
plot(data_asq, scale_id = 2)
Plot scale information
Description
plotInfo is a plotting function to visualize scale-level information.
Usage
plotInfo(
  object,
  data,
  theta = seq(-4, 4, 0.1),
  t_score = FALSE,
  scale_label = c(1, 2, "Combined"),
  color = c("red", "blue", "black"),
  lty = c(3, 2, 1)
)
## S4 method for signature 'SingleGroupClass'
plotInfo(
  object,
  data,
  theta = seq(-4, 4, 0.1),
  t_score = FALSE,
  scale_label = c(1, 2, "Combined"),
  color = c("red", "blue", "black"),
  lty = c(3, 2, 1)
)
Arguments
| object | a  | 
| data | a  | 
| theta | (optional) theta values to plot on the x-axis. (default =  | 
| t_score | (optional) set to  | 
| scale_label | (optional) names of each scale. This must have three values. (default =  | 
| color | (optional) line colors to plot. This must have three values. (default =  | 
| lty | (optional) line types to plot. This must have three values. (default =  | 
Examples
o <- runCalibration(data_asq, technical = list(NCYCLES = 1000))
plotInfo(o, data_asq)
Run a confirmatory factor analysis
Description
runCFA is a function for performing a one-factor confirmatory factor analysis (CFA) to test unidimensionality.
Usage
runCFA(data, estimator = "WLSMV", std.lv = TRUE, scalewise = FALSE, ...)
Arguments
| data | a  | 
| estimator | the estimator to be used. Passed onto  | 
| std.lv | if  | 
| scalewise | if  | 
| ... | additional arguments to pass onto  | 
Value
runCFA returns a list containing the CFA results.
Examples
out_cfa <- runCFA(data_asq, scalewise = TRUE)
lavaan::summary(out_cfa$`1`       , fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
lavaan::summary(out_cfa$`2`       , fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
lavaan::summary(out_cfa$`combined`, fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
Run Calibration
Description
runCalibration is a function for performing item parameter calibration on the response data.
Usage
runCalibration(
  data,
  dimensions = 1,
  fix_method = "free",
  fixedpar = NULL,
  ignore_nonconv = FALSE,
  verbose = FALSE,
  ...
)
Arguments
| data | a  | 
| dimensions | the number of dimensions to use. Must be 1 or 2.
If 1, use one underlying dimension for all instruments combined.
If 2, use each dimension separately for the anchor instrument and the developing instrument. Covariance between dimensions is freely estimated. (default =  | 
| fix_method | the type of constraints to impose. (default =  
 | 
| fixedpar | this argument exists for backward compatibility.  | 
| ignore_nonconv | if  | 
| verbose | if  | 
| ... | 
Value
runCalibration returns a SingleGroupClass object containing item calibration results.
This object can be used in coef, itemfit, itemplot in 'mirt' package to extract wanted information.
Examples
## Not run: 
out_calib <- runCalibration(data_asq) # errors
## End(Not run)
out_calib <- runCalibration(data_asq, technical = list(NCYCLES = 1000))
mirt::coef(out_calib, IRTpars = TRUE, simplify = TRUE)
mirt::itemfit(out_calib, empirical.plot = 1)
mirt::itemplot(out_calib, item = 1, type = "info")
mirt::itemfit(out_calib, "S_X2", na.rm = TRUE)
Run CTT-based reliability analysis
Description
runClassical is a function for performing a Classical Test Theory (CTT) based reliability analysis.
Usage
runClassical(data, omega = FALSE, scalewise = TRUE, ...)
Arguments
| data | a  | 
| omega | if  | 
| scalewise | if  | 
| ... | additional arguments to pass onto  | 
Value
runClassical returns a list containing reliability analysis results.
Examples
out_alpha <- runClassical(data_asq)
out_omega <- runClassical(data_asq, omega = TRUE) # also obtain omega
Obtain a descriptive statistics table
Description
runDescriptive is a descriptive function for obtaining descriptive statistics for each item in the dataset.
Usage
runDescriptive(data = NULL)
Arguments
| data | a  | 
Value
runDescriptive returns a data.frame containing descriptive statistics (mean, standard deviation, median, ...) of the items in the dataset. These are calculated with describe in 'psych' package.
Examples
out_desc <- runDescriptive(data_asq)
Run Test Equating
Description
runEquateObserved is a function for performing equipercentile equating between two scales.
runEquateObserved also produces a concordance table, mapping the observed raw scores from one scale to the scores from another scale.
Usage
runEquateObserved(
  data,
  scale_from = 2,
  scale_to = 1,
  type_to = "raw",
  rsss = NULL,
  eq_type = "equipercentile",
  smooth = "loglinear",
  degrees = list(3, 1),
  boot = TRUE,
  reps = 100,
  verbose = FALSE,
  ...
)
Arguments
| data | a  | 
| scale_from | the scale ID of the input scale. References to  | 
| scale_to | the scale ID of the target scale to equate to. References to  | 
| type_to | the type of score to use in the target scale frequency table. Accepts  | 
| rsss | the RSSS table to use to map each raw score level onto a t-score or a theta. See  | 
| eq_type | the type of equating to be passed onto  | 
| smooth | the type of smoothing method to be passed onto  | 
| degrees | the degrees of smoothing to be passed onto  | 
| boot | performs bootstrapping if  | 
| reps | the number of replications to perform in bootstrapping. (default =  | 
| verbose | if  | 
| ... | other arguments to pass onto  | 
Value
runEquateObserved returns an equate object containing the test equating result.
The printed summary statistics indicate the distributional properties of the two supplied scales and the equated scale.
- xcorresponds to- scale_from.
- ycorresponds to- scale_to.
- yxcorresponds to- scale_fromafter equating to- scale_to.
See equate for details.
The concordance table is stored in concordance slot.
Examples
out_eq_raw <- runEquateObserved(data_asq,
  scale_to = 1, scale_from = 2,
  eq_type = "equipercentile", smooth = "loglinear"
)
out_eq_raw$concordance
out_link <- runLinking(data_asq, method = "FIXEDPAR")
out_rsss <- runRSSS(data_asq, out_link)
out_eq_tscore <- runEquateObserved(data_asq,
  scale_to = 1, scale_from = 2,
  type_to = "tscore", rsss = out_rsss,
  eq_type = "equipercentile", smooth = "loglinear"
)
out_eq_tscore$concordance
Obtain a frequency table
Description
runFrequency is a descriptive function for obtaining a frequency table from the dataset.
Usage
runFrequency(data, check_frequency = TRUE)
Arguments
| data | a  | 
| check_frequency | if  | 
Value
runFrequency returns a data.frame containing the frequency table.
Examples
freq_asq <- runFrequency(data_asq)
freq_dep <- runFrequency(data_dep)
Run Scale Linking
Description
runLinking is a function for obtaining item parameters from the response data in the metric of supplied anchor item parameters.
Usage
runLinking(data, method, verbose = FALSE, ...)
Arguments
| data | a  | 
| method | the linking method to use. Accepts: 
 Linear transformation methods (i.e., MM, MS, HB, SL) are performed with  | 
| verbose | if  | 
| ... | 
Value
runLinking returns a list containing the scale linking results.
- constantslinear transformation constants. Only available when linear transformation methods were used (i.e., MM, MS, HB, SL).
- ipar_linkeditem parameters calibrated to the response data, and linked to the metric of anchor item parameters.
- ipar_anchoranchor item parameters used in linking.
Examples
out_link <- runLinking(data_asq, "SL", technical = list(NCYCLES = 1000))
out_link$constants   # transformation constants
out_link$ipar_linked # item parameters linked to anchor
out_link <- runLinking(data_asq, "FIXEDPAR")
out_link$ipar_linked # item parameters linked to anchor
Compute Crosswalk Tables
Description
runRSSS is a function for generating raw-score to standard-score crosswalk tables from supplied calibrated item parameters.
Usage
runRSSS(
  data,
  ipar_linked,
  prior_mean = 0,
  prior_sd = 1,
  min_theta = -4,
  max_theta = 4,
  inc = 0.05,
  min_score = 1
)
Arguments
| data | a  | 
| ipar_linked | an object returned from  | 
| prior_mean | prior mean. (default =  | 
| prior_sd | prior standard deviation. (default =  | 
| min_theta | the lower limit of theta quadratures for numerical integration. (default =  | 
| max_theta | the upper limit of theta quadratures for numerical integration. (default =  | 
| inc | the increment between theta quadratures for numerical integration. (default =  | 
| min_score | minimum item score (0 or 1) for each scale (1, 2, and combined). If a single value is supplied, the value is applied to all scales. (default =  | 
Value
runRSSS returns a list containing crosswalk tables.
Examples
out_link    <- runLinking(data_asq, method = "FIXEDPAR")
score_table <- runRSSS(data_asq, out_link)