Learn R Programming

starnet (version 0.0.7)

coef.starnet: Extract Coefficients

Description

Extracts pooled coefficients. (The meta learners weights the coefficients from the base learners.)

Usage

# S3 method for starnet
coef(object, nzero = NULL, ...)

Value

List of scalar alpha and vector beta, containing the pooled intercept and the pooled slopes, respectively.

Arguments

object

starnet object

nzero

maximum number of non-zero coefficients: positive integer, or NULL

...

further arguments (not applicable)

Examples

Run this code
# \dontshow{
if(!grepl('SunOS',Sys.info()['sysname'])){
set.seed(1)
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
coef <- coef(object)}# }
# \donttest{
set.seed(1)
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
coef <- coef(object)# }

Run the code above in your browser using DataLab