This took me forever to figure out, because I kept searching for terms like "change width" which directs you to line width code. Finally I found a snippet of code for xsize and searching that led me to this handy tutorial on aspect ratios and other fun scatter plot techniques.
My code:
twoway (scatter mathach newid, ylabel(-10(5)35)) (scatter meanmathach newid, connect(1) clcolor(red) sort), ysize(3) xsize(5)
Per the bolded code, the resulting graph will be produced in a 3x5 aspect ratio.
Showing posts with label STATA. Show all posts
Showing posts with label STATA. Show all posts
Thursday, April 11, 2013
Tuesday, March 5, 2013
Fun with GLM links
I can never keep this straight: When to use link(log) vs. link(logit) in generalized linear models:
Use link(log) when you are after relative risks.
Use link(logit) when you are after odds ratios.
Use link(log) when you are after relative risks.
Use link(logit) when you are after odds ratios.
Friday, February 8, 2013
Making notes in your code: STATA vs R
I'm used to coding in R at this point, so it took me a second to figure this out:
# This is a note in R code
vs.
* This is a note in STATA code
Other small things that are hard to get use to: in R, if your code spills into the next line, you just keep typing (I usually indent just to keep it looking clean); but in STATA, you have to include "///" at the end of an unfinished line of code, to tell it to continue reading on the next line.
STATA seems to stop running code when it encounters a problem (?) vs. R which keeps going, throwing up error messages when appropriate but following thru to the end.
# This is a note in R code
vs.
* This is a note in STATA code
Other small things that are hard to get use to: in R, if your code spills into the next line, you just keep typing (I usually indent just to keep it looking clean); but in STATA, you have to include "///" at the end of an unfinished line of code, to tell it to continue reading on the next line.
STATA seems to stop running code when it encounters a problem (?) vs. R which keeps going, throwing up error messages when appropriate but following thru to the end.
Subscribe to:
Posts (Atom)