Description Usage Arguments Details Value References See Also Examples

Creates fixed-X knockoff variables.

1 2 3 4 5 6 7 | ```
create.fixed(
X,
method = c("sdp", "equi"),
sigma = NULL,
y = NULL,
randomize = F
)
``` |

`X` |
normalized n-by-p matrix of original variables.( |

`method` |
either "equi" or "sdp" (default: "sdp"). This determines the method that will be used to minimize the correlation between the original variables and the knockoffs. |

`sigma` |
the noise level, used to augment the data with extra rows if necessary (default: NULL). |

`y` |
vector of length n, containing the observed responses.
This is needed to estimate the noise level if the parameter |

`randomize` |
whether the knockoffs are constructed deterministically or randomized (default: F). |

Fixed-X knockoffs assume a homoscedastic linear regression model for *Y|X*. Moreover, they only guarantee
FDR control when used in combination with statistics satisfying the "sufficiency" property.
In particular, the default statistics based on the cross-validated lasso does not satisfy this
property and should not be used with fixed-X knockoffs.

An object of class "knockoff.variables". This is a list containing at least the following components:

`X` |
n-by-p matrix of original variables (possibly augmented or transformed). |

`Xk` |
n-by-p matrix of knockoff variables. |

`y` |
vector of observed responses (possibly augmented). |

Barber and Candes, Controlling the false discovery rate via knockoffs. Ann. Statist. 43 (2015), no. 5, 2055–2085. https://projecteuclid.org/euclid.aos/1438606853

Other create:
`create.gaussian()`

,
`create.second_order()`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
p=100; n=200; k=15
X = matrix(rnorm(n*p),n)
nonzero = sample(p, k)
beta = 5.5 * (1:p %in% nonzero)
y = X %*% beta + rnorm(n)
# Basic usage with default arguments
result = knockoff.filter(X, y, knockoffs=create.fixed)
print(result$selected)
# Advanced usage with custom arguments
knockoffs = function(X) create.fixed(X, method='equi')
result = knockoff.filter(X, y, knockoffs=knockoffs)
print(result$selected)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.