censor_ped: Censor pedigree data

Description Usage Arguments Details Value See Also Examples

View source: R/ManipulatePed_Functions.R

Description

censor_ped censors a pedigree of any information that occurs after a specified year.

Usage

1
censor_ped(ped_file, censor_year = NULL)

Arguments

ped_file

An object of class ped. A pedigree generated by sim_ped or sim_RVped, or an object created by the function new.ped. See details.

censor_year

Numeric. The censor year. If not supplied, defaults to the year the pedigree was ascertained, i.e. the proband's onset year. See details.

Details

Upon supplying a pedigree and a censor year the censor_ped function will remove all individuals born after censor_year and censor all disease onset and death events after the censor_year.

Users who wish to use censor_ped for pedigrees not generated by sim_ped or sim_RVped must use new.ped to create an object of class ped. When creating the ped object please provide as much relevant date information as possible, i.e. years of birth, onset, and death. When present please specify a proband as described in new.ped.

By default, censor_year is set to the year that the pedigree is ascertained, i.e. the year the proband experienced disease onset. However, if ped_file does not contain the proband identification variable the user must supply a value for censor_year.

Value

The censored pedigree.

See Also

new.ped

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Read in age-specific harard data and create hazard object.
data(AgeSpecific_Hazards)
haz_obj <- hazard(hazardDF = AgeSpecific_Hazards)

#Simulate a pedigree ascertained for multiple affecteds
set.seed(3)
RVped2015 <- sim_RVped(hazard_rates = haz_obj,
                       num_affected = 2,
                       ascertain_span = c(1900, 2015),
                       GRR = 30, carrier_prob = 0.002,
                       RVfounder = TRUE,
                       stop_year = 2015,
                       recall_probs = c(1),
                       founder_byears = c(1900, 1905),
                       FamID = 1)[[2]]

# Plot the 2015 pedigree
plot(RVped2015)
mtext(side = 3, line = 2, "Reference Year: 2015")

# Censor RVped2015 after 1960
RVped1960 <- censor_ped(ped_file = RVped2015, censor_year = 1960)

# Plot the 1960 pedigree
plot(RVped1960)
mtext(side = 3, line = 2, "Reference Year: 1960")

simrvprojects/SimRVPedigree documentation built on Nov. 5, 2019, 8:55 a.m.