Given a dataset with the respondents and a dataset on the parents (in many cases the same individuals), and a set of relevant traits, estimate mixing parameters and return a markov model.
Value
A list with entries:
mixing.dfthe data used to estimate the mixing functionchoose.next.state.fna function which can be passed a vector of states and will return a draw of a subsequent state for each entry in the vectormixing.dfa dataframe (long-form) representation of the transition counts used to estimate the transition probabilitiesstatesa list with an entry for each state. within each state's entry aretrans.probsa vector of estimated transition probabilitiestrans.fna function which, when called, randomly chooses a next state with probabilities given by the transition probs.