R/Prgcm_HW1.R

Defines functions Prgcm_HW1

Prgcm_HW1 <-
function(vmc,p){    
                           v1<-ifelse(vmc[,1]==0 & vmc[,2]==0,1/(1+exp(p)),0)+
                           ifelse(vmc[,1]==0 & vmc[,2]==1,exp(p)/(1+exp(p)),0)+
                           ifelse(vmc[,1]==1 & vmc[,2]==0,1/(2*(1+exp(p))),0)+
                           ifelse(vmc[,1]==1 & vmc[,2]==1,1/2,0)+
                           ifelse(vmc[,1]==1 & vmc[,2]==2,exp(p)/(2*(1+exp(p))),0)+
                           ifelse(vmc[,1]==2 & vmc[,2]==1,1/(1+exp(p)),0)+
                           ifelse(vmc[,1]==2 & vmc[,2]==2,exp(p)/(1+exp(p)),0) 
                           return(v1)
                           }

Try the SPmlficmcm package in your browser

Any scripts or data that you put into this service are public.

SPmlficmcm documentation built on May 2, 2019, 6:14 a.m.