https://github.com/cran/bild
Raw File
Tip revision: 129f03a2619f3da43b97f463998ebb167c5a706d authored by M. Helena Gonçalves on 12 April 2020, 13:20:03 UTC
version 1.2-0
Tip revision: 129f03a
fixeff_bild.R
setMethod("fixeff", 
          signature(object="bild"),
          function(object) 
          {
            coef <- object@coefficients
            nas <- is.na(coef[, 1])
            cnames <- names(coef[, 1][!nas])
         
            
            # for dependence="ind" 
            if(all(is.na(match(cnames, "log.psi1"))) && 
               all(is.na(match(cnames, "log.psi2")))  &&
               all(is.na(match(cnames, "omega"))))
            {  
              return(coef[ ,  ])
            }
            

            # for dependence="MC1" 
            else if(!all(is.na(match(cnames, "log.psi1"))) && 
                    all(is.na(match(cnames, "log.psi2")))  &&
                    all(is.na(match(cnames, "omega"))))
            {
              return(coef[1:(dim(coef)[[1]]-1) ,  ])
            }
            
            
            # for dependence="MC2" 
            else if(!all(is.na(match(cnames, "log.psi1"))) && 
                    !all(is.na(match(cnames, "log.psi2")))  &&
                    all(is.na(match(cnames, "omega"))))
            {
              return(coef[1:(dim(coef)[[1]]-2) ,  ])
            }
            
 
            # for dependence="indR" 
            else if (all(is.na(match(cnames, "log.psi1"))) && 
                     all(is.na(match(cnames, "log.psi2"))) &&
                     !all(is.na(match(cnames, "omega"))))
            {
              return(coef[-dim(coef)[[1]],  ])
            }
            
            # for dependence="MC1R" 
            else if (!all(is.na(match(cnames, "log.psi1"))) && 
                      all(is.na(match(cnames, "log.psi2")))  &&
                     !all(is.na(match(cnames, "omega"))))
            {
              return(coef[1:(dim(coef)[[1]]-2),  ])
            }

            
            # for dependence="MC2R" 
            else if (!all(is.na(match(cnames, "log.psi1"))) && 
                     !all(is.na(match(cnames, "log.psi2")))  &&
                     !all(is.na(match(cnames, "omega"))))
            {
              return(coef[1:(dim(coef)[[1]]-3),  ])
            } 
            
          }
        )
back to top