checkMissingCovars: checkMissingCovars

View source: R/checkMissingCovars.r

checkMissingCovarsR Documentation

checkMissingCovars

Description

Identify potential covariates that fail to have data for at least 90

Usage

checkMissingCovars(tmp.df, m.i, df, trap, plot.file)

Arguments

tmp.df

The reduced data frame originating from df containing only efficiency-trial dates; i.e., those with non-NA nReleased values.

m.i

An integer containing the number of rows in data frame tmp.df.

df

The data frame for a specific TrapPositionID containing efficiency-trial information and covariates, if available, at the time of fitting enhanced efficiency trials in eff_model.r (or F.efficiency.model ).

trap

A trap for which efficiency data are available.

plot.file

The name of the file prefix under which output is to be saved. Set to NA to plot to the plot window.

Details

Function checkMissingCovars, surprisingly, checks for covariates with missing data. It outputs a csv or data rows with missing data. Generally, the function applies a 90% rule, meaning that 90% of the efficency trials in tmp.df must have covariate data available for ultimate consideration in enhanced efficiency models.

Value

A list containing several objects.

tmp.df

A copy of the tmp.df initially provided to the function with rows (efficiency trials) missing covariate data possibly removed.

df

A copy of the df initially provided to the function.

m.i

The number of efficiency trials with full rows of data. Necessarily less than or equal to the m.i provided to the function.

dataDeficient

The dataframe identifying the e-trial rows removed from tmp.df. Output as a csv.

atLeast

The threshold indicating the number of e-trial rows that must be non-missing for covariate inclusion. Equal to floor(0.90*m.i) + 1.

Examples

## Not run: 
ans <- checkMissingCovars(tmp.df,m.i,df,trap,plot.file)

## End(Not run)

tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.