README.md

HelpPackage

Go back to homepage

install.packages("devtools")
devtools::install_github('mcl868/HelpPackage')

This package contains following functions

Look at aipw to see more bla bla

listMean and listVar

Evaulate the mean and variance across a list

N<-1000
set.seed(3)
ListOfNorm<-list()
for(jj in 1:N){
  ListOfNorm[[jj]]<-matrix(rnorm(2,2),dimnames = list(c("a","b"),"value"))
}

listMean(ListOfNorm)
     value
a 1.996752
b 1.988997

listVar(ListOfNorm)
      value
a 1.0101092
b 0.9807797

listSums

Evaulate the sum across a list

N<-100
ListOfSum<-list()
for(jj in 1:N){
  ListOfSum[[jj]]<-matrix(c((1/2)^jj,jj),dimnames = list(c("a","b"),"value"))
}

listSums(ListOfSum)
  value
a     1
b  5050

mean.matrix

where k is the number of variable and n is the samplesize

Xbar<-matrix(c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2),10)

mean.matrix(Xbar)
     [,1] [,2]
[1,] 28.6 25.1
[2,] 25.1 28.9

Xbar[4,2]<-NA
mean.matrix(Xbar)
     [,1] [,2]
[1,] 28.6   NA
[2,]   NA   NA

mean.matrix(Xbar,na.rm=TRUE)
         [,1]     [,2]
[1,] 30.77778 26.55556
[2,] 26.55556 30.33333

indicator

indicator(condition, x)


mcl868/HelpPackage documentation built on March 30, 2020, 4:11 p.m.