Skip to content

Commit

Permalink
STAAR v0.9.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xihaoli committed Oct 25, 2024
1 parent 2ecb9b9 commit e2cbf6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions R/fit_null_glm_Binary_SPA.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fit_null_glm_Binary_SPA <- function(fixed, data, family = binomial(link = "logit
X <- model.matrix(obj_nullmodel)
working <- obj_nullmodel$weights

## generate XW
obj_nullmodel$XW <- t(X*working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X*working)%*%X)

Expand Down
10 changes: 5 additions & 5 deletions R/fit_null_glmmkin_Binary_SPA.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ fit_null_glmmkin_Binary_SPA <- function(fixed, data = parent.frame(), kins, use_
tauregion = tauregion, verbose = verbose, ...)
obj_nullmodel$sparse_kins <- TRUE

## generate W
X <- obj_nullmodel$X
muhat <- obj_nullmodel$fitted.values
working <- muhat*(1-muhat)

## generate XW
obj_nullmodel$XW <- t(X*working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X*working)%*%X)

## generate Sigma_i
## generate XSigma_i
obj_nullmodel$XSigma_i <- crossprod(X,obj_nullmodel$Sigma_i)
obj_nullmodel$XXSigma_iX_inv <- X%*%obj_nullmodel$cov
}else if(!is.null(use_sparse) && use_sparse){
Expand All @@ -105,15 +105,15 @@ fit_null_glmmkin_Binary_SPA <- function(fixed, data = parent.frame(), kins, use_
tauregion = tauregion, verbose = verbose, ...)
obj_nullmodel$sparse_kins <- TRUE

## generate W
X <- obj_nullmodel$X
muhat <- obj_nullmodel$fitted.values
working <- muhat*(1-muhat)

## generate XW
obj_nullmodel$XW <- t(X*working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X*working)%*%X)

## generate Sigma_i
## generate XSigma_i
obj_nullmodel$XSigma_i <- crossprod(X,obj_nullmodel$Sigma_i)
obj_nullmodel$XXSigma_iX_inv <- X%*%obj_nullmodel$cov
}else{
Expand All @@ -126,11 +126,11 @@ fit_null_glmmkin_Binary_SPA <- function(fixed, data = parent.frame(), kins, use_
tauregion = tauregion, verbose = verbose, ...)
obj_nullmodel$sparse_kins <- FALSE

## generate W
X <- obj_nullmodel$X
muhat <- obj_nullmodel$fitted.values
working <- muhat*(1-muhat)

## generate XW
obj_nullmodel$XW <- t(X*working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X*working)%*%X)
}
Expand Down

0 comments on commit e2cbf6a

Please sign in to comment.