Learn R Programming

aucm (version 2016.1-2)

get.X.diff: get.X.diff

Description

computes X.diff matrix

Usage

get.X.diff (x1,...)
## S3 method for class 'default':
get.X.diff(x1,x2,...)
## S3 method for class 'formula':
get.X.diff(formula, data,...)

Arguments

x1
data matrix from the case group, dimension n1 x d
x2
data matrix from the non-case group, dimension n2 x d
formula
a formula
data
a data frame
...
arguments passed 'to' or 'from' methods

Value

  • A (n1*n2) x d matrix

Details

In get.X.diff.formula, x is the case predictors and x2 control.

Examples

Run this code
dat = sim.dat.1(n=100,seed=1)
X1 = as.matrix(subset(dat, y==0, select=c(x1,x2)))
X2 = as.matrix(subset(dat, y==1, select=c(x1,x2)))
X.diff = get.X.diff (X1, X2)
dim(X1)
dim(X2)
dim(X.diff)

Run the code above in your browser using DataLab