Learn R Programming

mxfda (version 0.2.2-1)

impute_fpca: impute_fpca

Description

Internal function called by TITLE: regression function that imputes missing data in functional predictors using FPCA.

Usage

impute_fpca(
  mxfundata,
  id,
  r = "r",
  value = "fundiff",
  knots = NULL,
  analysis_vars,
  smooth
)

Value

A dataframe where the missing function values (NA) for the value variable have been replaced with estimates from FPCA.

Arguments

mxfundata

Dataframe of spatial summary functions from multiplex imaging data, in long format. Can be estimated using the function extract_summary_functions or provided separately.

id

Character string, the name of the variable that identifies each unique subject.

r

Character string, the name of the variable that identifies the function domain (usually a radius for spatial summary functions). Default is "r".

value

Character string, the name of the variable that identifies the spatial summary function values. Default is "fundiff".

knots

Number of knots for defining spline basis.

analysis_vars

Optional list of variables to be retained for downstream analysis.

smooth

Option to smooth data using FPCA.

Author

Julia Wrobel julia.wrobel@emory.edu

Examples

Run this code
# simulate data
set.seed(1001)

Run the code above in your browser using DataLab