# Loading Valente's SNS data
data(valentesnsList)
mymodel <- new_defm(
id = valentesnsList$id,
Y = valentesnsList$Y,
X = valentesnsList$X,
order = 1
)
# Adding the intercept terms and a motif from tobacco to mj
term_defm_logit_intercept(mymodel)
term_defm_transition_formula(mymodel, "{y1, 0y2} > {y1, y2}")
# Initialize the model
init_defm(mymodel)
# Motif counts featuring only the first two variables
motif_census(mymodel, locs = 0:1)
Run the code above in your browser using DataLab