brazerzkidaibooking.blogg.se

Geodist all bilateral pairs stata
Geodist all bilateral pairs stata









geodist all bilateral pairs stata
  1. #Geodist all bilateral pairs stata install
  2. #Geodist all bilateral pairs stata code
geodist all bilateral pairs stata geodist all bilateral pairs stata

This should work after any model as long as the naming conventions for the assigned groups are _traj_Group and the posterior probabilities are in the variables _traj_ProbG*. List _traj_Group countG groupAPP occ occ_pp p TotProb if counter = 1 *and the observed probability of groups versus the probability *the odds of correct classification (based on the weighted post. *the odds of correct classification (based on the max post prob group assignment), *the average posterior probability for each group, *the count per group (based on the max post prob), Replace TotProb = r(sum)/ _N if _traj_Group = c *now lets look at the average posterior probability

#Geodist all bilateral pairs stata code

*updating code to drop missing assigned observations *I made a function to print out summary stats Here I made a program that I will surely be ashamed of later (I should not brutalize the data and do all the calculations in matrix), but it works and produces an ugly table to get us these stats. Now for absolute model fit statistics, there are the average posterior probabilities, the odds of correct classification, and the observed classification proportion versus the expected classification proportion. traj, var(count_*) indep(t_*) model(zip) order(2 2 2) iorder(0) Now we can estimate our group based models, and we get a pretty nice default plot. *Need to generate a set of time variables to pass to traj, just label 1 to 10 So I create a set of t_ variables to mimic the counts, going from 1 to 10. The traj command also wants you to input a time variable though to, which I do not have in this file. Second, the traj model expects the data in wide format (which this data set already is), and has counts in count_1, count_2 … count_10. Here my first variable was read in as ïid instead of id (I’m thinking because of the encoding in the csv file). Once that is taken care of after setting the working directory, I can simply load in the csv file.

#Geodist all bilateral pairs stata install

So after running that then I can install the traj command, and Stata will know where to look for it! Net set ado "C:\Users\axw161530\Documents\Stata_PlugIns" *to install on your own in the lab it would be First I have this set of code in the header of all my do files now *let stata know to search for a new location for stata plug insĪdopath + "C:\Users\axw161530\Documents\Stata_PlugIns" To install the group based trajectory code. The code and the simulated data I made to reproduce this analysis can be downloaded here.įirst, for my own notes my version of Stata is on a server here at UT Dallas. This is the first time I’ve really sat down and programmed extensively in Stata, and this is a followup to produce some of the same plots and model fit statistics for group based trajectory statistics as this post in R. For my advanced research design course this semester I have been providing code snippets in Stata and R.











Geodist all bilateral pairs stata