construct_newdata: Construct a data.frame from which to predict model values.

Description Usage Arguments Value Author(s) References Examples

View source: R/construct_newdata.R

Description

Construct a data.frame from which to predict model values.

Usage

1
2
3
4
5
6
7
8
construct_newdata(
  clean_DF_restricted,
  x_pred_type = maeve_options("x_pred_type"),
  x_pred_vec = maeve_options("x_pred_vec"),
  x_pred_interior_grid = maeve_options("x_pred_interior_grid"),
  x_pred_spacing = maeve_options("x_pred_spacing"),
  include_newdata_ID = maeve_options("include_newdata_ID")
)

Arguments

clean_DF_restricted

data frame with data restricted to those used in fitting the models. Most often set to 'clean_DF_restricted' data.frame returned from maeve::model_study().

x_pred_type

character. See ?maeve_options().

x_pred_vec

numeric vector. See ?maeve_options().

x_pred_interior_grid

logical. See ?maeve_options().

x_pred_spacing

numeric. See ?maeve_options().

include_newdata_ID

logical. See ?maeve_options().

Value

An R data.frame

Author(s)

Bill Forrest <forrest@gene.com>

Bill Forrest forrest@gene.com

References

www.r-project.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 require( magrittr ) # want pipe operator "%>%"
 ##
 vismo21 <- 
   vismodegib %>%
   dplyr::filter( DAY_OF_STUDY <= 21 ) %>%
   dplyr::rename( group = group_name, ID = animalID, x = DAY_OF_STUDY ) # internal names
 ## pass this to the construct_newdata() function.
 vismo21_grid <-   
   vismo21 %>% # make, e.g., an even grid with one-day resolution:
   maeve:::construct_newdata( x_pred_type = 'grid', x_pred_spacing = 1 )

wfforrest/maeve documentation built on Jan. 1, 2021, 12:47 p.m.