Learn R Programming

apc (version 2.0.0)

apc.data.list.subset: Cut age, period and cohort groups from data set.

Description

For a recursive analysis it is useful to be able to cut age, period and cohort groups from a data set. Function returns an apc.data.list with data.format "trapezoid".

When used with default values the function turns an apc.data.list into a new apc.data.list with data.format "trapezoid" without reducing dataset.

Usage

apc.data.list.subset(apc.data.list,
							age.cut.lower=0,age.cut.upper=0,
							per.cut.lower=0,per.cut.upper=0,
							coh.cut.lower=0,coh.cut.upper=0,
							apc.index=NULL,
							suppress.warning=FALSE)

Value

response

matrix (or vector). Numbers of responses.

dose

matrix (or NULL). Numbers of doses.

data.format

"trapezoid"

age1

Numeric.

per1

Numeric.

coh1

Numeric.

unit

Numeric.

per.zero

Numeric.

per.max

Numeric.

Arguments: Notes

If apc.index is supplied then the input can be simplified. It suffices to write apc.data.list = list(response=response,data.format=data.format,dose=dose), where dose could be dose=NULL. Likewise apc.index does not need to be a full apc.index list. It suffices to construct a list with entries age.max, per.max, coh.max, age1, per1, coh1, unit, per.zero, index.trap, index.data.

See Also

The below example uses artificial data. For an example using data.asbestos see apc.plot.fit.

Examples

Run this code
# NOT RUN {
###############
#	Artificial data
#	Generate a 5x7 matrix and make arbitrary decisions for rest

response <- matrix(data=seq(1:35),nrow=5,ncol=7)
data.list	<- list(response=response,dose=NULL,data.format="AP",
					age1=25,per1=1955,coh1=NULL,unit=5,
					per.zero=NULL,per.max=NULL,time.adjust=0)
data.list

apc.data.list.subset(data.list,1,1,0,0,0,0)


# }

Run the code above in your browser using DataLab