# create a random scdf with predefined parameters
set.seed(1234)
design <- design(
n = 10, trend = -0.02,
level = list(0, 1), rtt = 0.8,
s = 1
)
scdf<- random_scdf(design)
# Estimate the parameters based on the scdf and create a new random scdf
# based on these estimations
design_est <- estimate_design(scdf, rtt = 0.8)
scdf_est <- random_scdf(design_est)
# Analyze both datasets with an hplm model. See how similar the estimations
# are:
hplm(scdf, slope = FALSE)
hplm(scdf_est, slope = FALSE)
# Also similar results for pand and randomization tests:
pand(scdf)
pand(scdf_est)
rand_test(scdf)
rand_test(scdf_est)
Run the code above in your browser using DataLab