# NOT RUN {
# }
# NOT RUN {
# Standard run:
haplin("data.dat")
# Specify path, estimate maternal effects:
haplin("C:/work/data.dat", maternal = T)
# Specify path, use haplotype no. 2 as reference:
haplin("C:/work/data.dat", reference = 2)
# Remove more haplotypes from estimation by increasing the threshold
# to 5%:
haplin("C:/work/data.dat", threshold = 0.05)
# Estimate maternal effects, using the most frequent haplotype as reference.
# Use all data, including triads with missing data. Select
# markers 3, 4 and 8 from the supplied data.
haplin("C:/work/data.dat", use.missing = T, maternal = T,
reference = "ref.cat", markers = c(3,4,8))
# Note: in this version of haplin, the jackknife is
# no longer necessary since the standard errors are already corrected.
# Some examples showing how to save the haplin result and later
# recall plot and summary results:
# Same analysis as above, saving the result in the object "result.1":
result.1 <- haplin("C:/work/data.dat", use.missing = T, maternal = T,
reference = "ref.cat", markers = c(3,4,8))
# Replot the saved result (fetal effects):
plot(result.1)
# Replot the saved result (maternal effects):
plot(result.1, plot.maternal = T)
# Print a very short summary of saved result:
result.1
# A full summary of saved result, with confidence intervals and
# p-values (the same as haplin prints when running):
summary(result.1)
# Some examples when the data file contains two covariates,
# the second is the case-control variable:
# The following standard triad run is INCORRECT since it disregards
# case status:
haplin("data.dat", use.missing = T, n.vars = 2, design = "triad")
# Combined run on "hybrid" design, correctly using both case-parent
# triads and control-parent triads:
haplin("data.dat", use.missing = T, n.vars = 2, ccvar = 2,
design = "cc.triad")
# If parent columns are not in the file, a plain case-control
# run can be used:
haplin("data.dat", use.missing = T, n.vars = 2, ccvar = 2,
design = "cc", response = "mult", reference = "ref.cat")
# An example of how to produce a data file with all possible haplotypes
# identified for each triad, together with their probaility weights:
result.data <- haplin("C:/work/data.dat", use.missing = T,
markers = c(3,4,8), data.out = "prelim")
# result.data will then contain the data file, with a vector of
# probabilities (freq) computed from the preliminary haplotype
# frequencies.
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab