Skip to contents

Function that transforms functional models from linear or additive functional cox models into afcmSurface or lfcmSurface objects to be plotted.

Usage

extract_surface(
  mxFDAobject,
  metric,
  model = NULL,
  r = "r",
  value = "fundiff",
  grid_length = 100,
  analysis_vars,
  p = 0.05,
  filter_cols = NULL
)

Arguments

mxFDAobject

object of class mxFDA with model model calculated wihtin

metric

spatial summary function to extract surface for

model

character string for the name of the model for metric data

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".

grid_length

Length of grid on which to evaluate coefficient functions.

analysis_vars

Other variables used in modeling FCM fit.

p

numeric p-value used for predicting significant AFCM surface

filter_cols

a named vector of factors to filter summary functions to in c(Derived_Column = "Level_to_Filter") format

Value

a 4 element list of either class lfcmSurface or afcmSurface depending on the class of model

Surface

data.frame for term predictions for the surface of the metric * radius area

Prediction

data.frame for standard error of the terms for the above surface. AFCM models use the p to set the upper and lower standard errors of \(\beta_1\)

Metric

character of the spatial summary function used; helps keep track if running many models

P-value

a numeric value of the input p-value

Author

Julia Wrobel julia.wrobel@emory.edu

Alex Soupir alex.soupir@moffitt.org

Examples

#load ovarian mxFDA object
data('ovarian_FDA')

#run the lfcm model
ovarian_FDA = run_fcm(ovarian_FDA, model_name = "fit_lfcm",
                      formula = survival_time ~ age, event = "event",
                      metric = "uni g", r = "r", value = "fundiff",
                      analysis_vars = c("age", "survival_time"),
                      afcm = FALSE)

#extract surface
model_surface = extract_surface(ovarian_FDA, metric = 'uni g',
                                model = 'fit_lfcm',
                                analysis_vars = 'age') #variables in model