makeK | R Documentation |
Builds the Gaussian kernel matrix using Rcpp.
makeK(allx, useasbases = NULL, b = NULL, linkernel = FALSE, scale = TRUE)
allx |
A data matrix containing all observations where rows are units and columns are covariates. |
useasbases |
Vector argument containing one's and zero's with length equal to the number of observations (rows in |
b |
Scaling factor in the calculation of Gaussian kernel distance equivalent to the entire denominator |
linkernel |
Indicates that user wants linear kernel, |
scale |
boolean flag for whether or not to standardize |
K |
The kernel matrix |
#load and clean data a bit
data(lalonde)
xvars=c("age","black","educ","hisp","married","re74","re75","nodegr","u74","u75")
#note that lalonde$nsw is the treatment vector, so the observed is 1-lalonde$nsw
#running makeK with the sampled/control units as the bases given
#the large size of the data
K = makeK(allx = lalonde[,xvars], useasbases = 1-lalonde$nsw)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.