impute_fpca {mxfda}R Documentation

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
)

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.

Value

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

Author(s)

Julia Wrobel julia.wrobel@emory.edu

Examples

# simulate data
set.seed(1001)


[Package mxfda version 0.2.1 Index]