censMove.1: Censored Maintenance of Variance Extension, Type 1

View source: R/censMove.1.R

censMove.1R Documentation

Censored Maintenance of Variance Extension, Type 1

Description

Calculates the Maintenance Of Variance Extension, Type 1 (MOVE.1) for record extension by fitting a Line of Organic Correlation (LOC) regression model to left-censored data.

Usage

censMove.1(formula, data, subset, na.action, distribution = "normal")

Arguments

formula

a formula with a single response variable on the left and a single explanatory variable on the right. See Details.

data

the data to search for the variables in formula.

subset

an expression to select a subset of the data.

na.action

what to do with missing values.

distribution

the distribution of the data, either "normal," "lognormal," or "commonlog." See Details.

Details

The left- or right-hand side of the formula may be any numeric variable, just as with move.1 or a variable of class "lcens." The response variable must be the name of a column and not converted using as.lcens in the call.

If distribution is "normal," then the data in x and y are assumed to have a bivariate normal distribution. Otherwise, they are assumed to have a bivariate log-normal distribution and a logarithmic transform is applied to both x and y before analysis. The natural logarithm is used if distribution is "lognormal" and the commmon logarithm is used if distribution is "commonlog."

Value

An object of class "move.1" as decribed in the documentation for move.1. Except, there are no fitted.values or residuals components, the values of x and y include estimated values (See Note), and components cx and cy, which indicate left-censoring are included.

Note

Because predictions are made using the predict method for class "move.1," and do not expect censored values, the explanatory variable in formula must refer to a column in data and not converted using the as.lcens function; the user must convert the explanatory variable column to class "lcens" before using censMove.1.

The components x and y are the actual values if the data are uncensored. If y is censored and x is not censored, then y is the expected value of y, given its censored value and the value of x and likewise for x censored and y not censored. If both are cesnored, then the values are computed from their expected values given the censored value without respect to any condition of the other.

References

will need some.

See Also

move.1

Examples

## Not run: 
library(smwrData)
data(IonBalance)
# Build model for non missing Alkalinity
move.1(Anion_sum ~ Cation_sum, data=IonBalance, 
 subset=abs(Pct_Diff) < 10) 
# Compare to censored
censMove.1(Anion_sum ~ Cation_sum, data=IonBalance, 
 subset=abs(Pct_Diff) < 10) 
# The difference in standard deviations is due to using sd/MLE 

## End(Not run)


USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.