Description Usage Arguments Details Value See Also Examples
View source: R/ManipulatePed_Functions.R
censor_ped
censors a pedigree of any information that occurs after a specified year.
1 | censor_ped(ped_file, censor_year = NULL)
|
ped_file |
An object of class |
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. |
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
.
The censored pedigree.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.