
When displaying that interaction effect though, I only want to limit it to the support of the historical crime density in the sample. I am predicting whether a crime results in a near-repeat follow up - hot spots with more crime on average will have more near-repeats simply by chance. So basically what I want to do in the end is to draw an interaction effect between a dummy variable (whether a crime resulted in an arrest) and a continuous variable (the historical crime density at a location). *For here I am just examining burglary incidents Global ContVars "d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 whiteperc blackperc hispperc asianperc under17 propmove perpoverty perfemheadhouse perunemploy perassist i.month c.dateint" *control variables used in the regression *Making the previous densities per time period Import delimited CrimeStrings_withData.csv Finally for simplicity in this script I am just examining the burglary incidents, so I get rid of the other crimes using the keep command. One trick I like to use with regression models with many terms is to make a global that specifies those variables, so I don’t need to retype them a bunch. I read in the data as a CSV file, generate a new variable that is the weekly average number of crimes within 1000 feet in the historical crime data (see the working paper for more details). That will be more productive than me commenting on every individual line. Again check out Ben Jann’s awesome website he made an all the great examples. Here is what I did to change my default graph settings. Net set ado "C:\Users\axw161530\Documents\Stata_PlugIns\V15" *let stata know to search for a new location for stata plug insĪdopath + "C:\Users\axw161530\Documents\Stata_PlugIns\V15" Log using "LogitModels.txt", text replace

*Set the working directory and plain text log fileĬd "C:\Users\axw161530\Dropbox\Documents\BLOG\Stata_NiceMargins\Analysis" But it is good for others to know what extra packages they need to fully replicate your results.
#RENAME X AXIS LABELS STATA INSTALL#
The code is currently commented out, as I only need to install it once. So I add a location to adopath that is on my machine, and I also do net set ado to that same location.įinally, for here I ssc installed grstyle and palettes. I don’t have write access there, so to install commands I need to set my own place to install them on my local machine. The next part is partly idiosyncratic to my Stata work set up - I call Stata from a centralized install location here at EPPS in UTD. I use set more off so I don’t have to do the annoying this and tell Stata to keep scrolling down. Start Upįirst in my do file, I have a typical start up that sets the working directory and logs the results to a text file. Data and code to follow along can be downloaded from here.

#RENAME X AXIS LABELS STATA HOW TO#
Other users who have found the question cross-posted are encouraged to share the links as a reply as well.My notes on how to get this to follow. If you've asked a question, let people know where else you asked the question and what your solution(s) were! When you post a question on another platform, include those links in your questions or as a reply (if it's Discord, just mention it).See the sticked "READ ME: How to best ask for help in /r/Stata" post on how to comment here if all else fails. Make sure to include the word "Stata" in your search query. Perform a web search for your question prior to posting here. Stata's online community has been active for many years and many questions and solutions are documented on StataList, which are highly indexed on contemporary search engines (e.g., Google). Stata has extensive and complete documentation you can read before posting here (and you can type help followed by the command name in console to see it, e.g. This is not a place to find Stata tutoring. Do not request that the /r/Stata community do your homework for you. Assume good faith questions and comments. Be nice when posting or commenting to a post.The Code Block on Discord (run by Asjad Naqvi of The Stata Guide).
