Runs PLN function from the PLNmodels package and normalized the outputs

norm_PLN(Y, X = NULL, O = NULL)

Arguments

Y

Count dataset (n x p).

X

Matrix of covariates (n x d).

O

Matrix of offsets (n x p).

Value

  • MO: normalized means (n x p).

  • SO: normalized marginal variances (n x p).

  • sigma_O: correlation matrix (p x p) computed from the variance-covariance matrix estimated by PLNmodels, and corresponding to observed variables.

  • theta: matrix of the covariates regression coefficients (p x (d+1) including the intercept).

Examples

n=100 # 100 samples p=10 # 10 species r=1 # 1 missing actor data=generate_missing_data(n=n,p=p,r=r,type="scale-free", plot=TRUE)
X=data.frame(X1=rnorm(n), X2=runif(n)) normPLNfit<-norm_PLN(data$Y,X) str(normPLNfit)
#> List of 4 #> $ MO : num [1:100, 1:10] -0.4107 1.3302 0.6974 1.1092 -0.0268 ... #> $ SO : num [1:100, 1:10] 0.135 0.0378 0.0663 0.0475 0.1143 ... #> $ sigma_O: num [1:10, 1:10] 1 -0.64 0.406 0.476 0.373 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:10] "Y1" "Y2" "Y3" "Y4" ... #> .. ..$ : chr [1:10] "Y1" "Y2" "Y3" "Y4" ... #> $ theta : num [1:10, 1:3] 1.81 2.12 1.61 2.14 1.81 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:10] "Y1" "Y2" "Y3" "Y4" ... #> .. ..$ : chr [1:3] "(Intercept)" "XX1" "XX2"