Closed stephens999 closed 5 years ago
if y is input as a 1 by n matrix then compute_ss completes but returns a matrix of NAs for the var(y) instead of a scalar...
compute_ss
set.seed(1) n <- 1000 p <- 1000 beta <- rep(0,p) beta[1:4] <- 1 X <- matrix(rnorm(n*p),nrow=n,ncol=p) y <- t(X %*% beta + rnorm(n)) # note i replaced c() with t() here input_ss <- compute_ss(X,y,standardize = TRUE) input_ss$vary
it is probably better to use sd instead of var to compute sample variance of a vector ?
sd
var
A bigger picture issue is that it might be clearer to use yty instead of vary throughout as for vary it is unclear whether you divide by n or (n-1)...
@stephens999 we have agreed to use yty in the new susie_ss function. Will close when it is done.
yty
susie_ss
if y is input as a 1 by n matrix then
compute_ss
completes but returns a matrix of NAs for the var(y) instead of a scalar...it is probably better to use
sd
instead ofvar
to compute sample variance of a vector ?A bigger picture issue is that it might be clearer to use yty instead of vary throughout as for vary it is unclear whether you divide by n or (n-1)...