R/vcov.selection.R

Defines functions vcov.selection

Documented in vcov.selection

vcov.selection <- function( object, part = "full", ... ) {

   if( !( part %in% c( "full", "outcome", "est" ) ) ) {
      stop( "argument 'part' must be either 'full', 'outcome', or 'est'" )
   }

   if( part == "full" & !is.null( object$vcovAll ) ){
      result <- object$vcovAll
   } else if( object$method == "ml" ){
      result <- NextMethod( "vcov", object, ...)
   } else if( object$method == "2step" ) {
      result <- object$vcov
   }

   if( part == "outcome" ) {
      result <- result[ object$param$index$outcome, object$param$index$outcome ]
   }

   return( result )
}

Try the sampleSelection package in your browser

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

sampleSelection documentation built on Jan. 13, 2021, 7:49 p.m.