debias_plsmm: Post-selection inference for PLSMM

View source: R/posi.R

debias_plsmmR Documentation

Post-selection inference for PLSMM

Description

This function debias the lasso coefficients estimated from the plsmm_lasso function and computes p-values.

Usage

debias_plsmm(x, y, series, plsmm_output, a = 1, Z = NULL)

Arguments

x

A matrix of predictor variables.

y

A continuous vector of response variable.

series

A variable representing different series or groups in the data modeled as a random intercept.

plsmm_output

Output object obtained from the plsmm_lasso function.

a

A scalar that adjusts the variance of the random intercept \phi by a \times \sigma_{\phi}, default is 1.

Z

(Optional) Pre-computed correction score matrix. If provided, it will be used directly for debiasing.

Details

The original data is decorrelated, and a correction score matrix is computed. The correction scores are a measure of correlation between the predictors in the data. The debiasing process utilizes these scores to compute debiased estimates of the coefficients, along with associated p-values.

Value

A data frame containing debiased coefficients, standard errors, confidence intervals, and p-values.

Examples


set.seed(123)
data_sim = simulate_group_inter(N = 50, n_mvnorm = 3, grouped = TRUE,
                                timepoints = 3:5, nonpara_inter = TRUE,
                                sample_from = seq(0,52,13),
                                cos = FALSE, A_vec = c(1, 1.5))
sim = data_sim$sim
x = as.matrix(sim[,-1:-3])
y = sim$y
series = sim$series
t = sim$t
bases = create_bases(t)
lambda <- 0.0046
gamma <- 0.00000001
plsmm_output <- plsmm_lasso(x, y, series, t,
  name_group_var = "group", bases$bases,
  gamma = gamma, lambda = lambda, timexgroup = TRUE,
  criterion = "BIC"
)
debias_plsmm(x, y, series, plsmm_output)



plsmmLasso documentation built on June 22, 2024, 9:35 a.m.