rf_semipar: Random Forest Helper Functions

Description Usage Arguments Examples

Description

Estimate a partially linear model using the robinson 1988 methodology using random forests as the nonparametric regression technology. The formula structure has three parts: y ~ x | z. y is the outcome, x are the linear variables and z are the non-parametric variables. Tt *should* work with whatever transformations you throw at it, but note that the resulting lm object it returns may have column names that are slightly different if you do transformations. For example, the variables in the output of a model drilled ~ Auction + log(acres) | Cent_Lat + Cent_Long + EffDate will be Auction and *log_acres_*. ALSO: if you put something more complicated in, like, say, a call to bs() from the splines package, you are going to get pretty crazy names, but it should still work.

Usage

1

Arguments

formula

The regression formula to evaluate

data

The dataframe that contains all the variables used in the formula

Examples

1
2
3
4
5
6
7
8
height <- runif(100, 60, 78)
dad_height <- runif(100, 66, 78)
mom_height <- runif(100, 60, 72)
df <- tibble(height = height, dad_height = dad_height, 
   mom_height = mom_height)

model <- rf_semipar(height ~ dad_height | mom_height, data = df)
 

yixinsun1216/catwalk documentation built on May 31, 2019, 4:56 a.m.