How do you use a regression equation generated from one independent set of data to create predicted probabilities for another independent set of data with the same variables? Essentially I would like to "save" the regression equation from my first dataset to predict for another dataset from a different year. Is this possible? Please excuse me if this information is on the website but I have been having difficulty while attempting to execute this particular task.
Thank you for your help
Raifu Durodoye Jr.
Thank you. Fixing the 'a' allowed it to run through the loop. However, now I am having trouble graphing the results. I have stata 10 and tried to set it back to stata 7 as per one of the earlier post but it did not work. My "y axis" lines up at -1 to 1, the same as my x-axis. This is the code I used for the graph as p:
sort xaxis
graph plo phi xaxis, s(ii) c(||)
I get nothing when I include the s and c terms. If I exclude those terms, I just get the plo and the phi concentrated at the 1 value on the y axis. Thanks much. Amy
I am having difficulty graphing my results in Clarify.
I have tried various versions of code. What I what to do is first have on the xaxis are ideology scores going from -1 to 1. I am doing a pooled logit with a large number of observations and I want to analyze vote choice based on ideology and region.
Here is my code. I tried various iterations of this and it keeps telling me "a is an invalid name"
estsimp logit vote core ideology1
generate plo = .
generate phi = .
generate xaxis = _n -2 in 1/2 (I alternatively tried putting the number of observations in here which is 69000).
setx core 1
local a = -1
while `a' <= 1 (I have also tried this with other numbers) {
setx ideology1 'a'
simqi, prval(1) genpr(pi)
_pctile pi, p(2.5,97.5)
replace plo = r(r1) if xaxis==`a'
replace phi = r(r2) if xaxis==`a'
drop pi
local a = `a' - 1 (I have also tried this with +1)
}
Thank you for your assistance.
Hi -
I'm trying to create a predicted probability graph that includes confidence
intervals with data simulated with Clarify. Using the instructions from the
Clarify manual about how to recreate the graphs from the 2001 AJPS article,
I'm having some trouble in part b/c I think that the graphing commands in
the manual are somewhat different than the ones that Stata 10 uses.
What I need to know is what the right Stata 10 command is after "graph" in
the original instructions that will give me a line graph with confidence
intervals. Right now I'm using the "lfit" command (see my code below) but
that isn't right.
Any help would be much appreciated. Thanks!
Here are the instructions from the Clarify manual to create a graph with 99%
CI:
generate plo = .
generate phi = .
generate ageaxis = _n + 17 in 1/78
setx educate 12 white 1 income mean
local a = 18
while `a' <= 95 {
setx age `a' agesqrd (`a'^2)/100
simqi, prval(1) genpr(pi)
_pctile pi, p(2.5,97.5)
replace plo = r(r1) if ageaxis==`a'
replace phi = r(r2) if ageaxis==`a'
drop pi
local a = `a' + 1
}
sort ageaxis
graph plo phi ageaxis, s(ii) c(||)
Here is the code that I'm using from my data.
estsimp regress index02 Ideology pid AvgTV02_hat newspaper02_hat if
ThreatTerror02 < .5
generate plo = .
label var plo "Low threat"
generate TVaxis = _n-1 in 1/100
label var TVaxis "Days watching TV per week"
setx mean
setx AvgTV02_hat 0
local a = 1
local b = 0
while `a'<= 100 {
setx AvgTV02_hat (`b')
simqi, ev genev(pi)
_pctile pi, p(5,95)
replace plo = pi if TVaxis == `a'
drop pi
local a = `a' + 1
local b = `b' +.01
}
drop b1-b5 b6
estsimp regress index02 Ideology pid AvgTV02_hat newspaper02_hat if
ThreatTerror02 > .5
generate phi = .
label var phi "High threat"
setx mean
setx mean
local a = 1
local b = 0
while `a'<= 100 {
setx AvgTV02_hat (`b')
simqi, ev genev(pi)
_pctile pi, p(5,95)
replace phi = pi if TVaxis == `a'
drop pi
local a = `a' + 1
local b = `b' + .01
}
replace TVaxis = TVaxis/100
sort TVaxis
*Predicted values for IV model - included in the job talk*
twoway (lfit plo TVaxis, lcolor(blue) lpattern(shortdash_dot)) (lfit phi
TVaxis, lcolor(navy) lpattern(longdash)), ytitle(Hawkishness)
ylabel(.2(.1).8) xtitle(TV watching per week) xlabel( 0 "No TV" .5 "Mean TV"
1 "Every day", angle(horizontal) labsize(small)) title(Foreign Policy
Attitudes 2002) caption(IV predicted values, size(small)) note(Source:
2000-2004 NES, size(small)) legend(rows(1) order(1 "Low threat" 2 "High
threat") size(small)) scheme(s1color)
Shana
Shana Kushner Gadarian
Department of Politics
Princeton University
skushner(a)princeton.edu
www.princeton.edu/~skushner
Attn winner
Your e-mail address has won 908,273.21EUR. contact your claim agent Adams Fernando Mr.) TEL: +34-63-4094-626. ref nu: NW-984 4ESP, Lucky Num 5246-4465, Ticket Num: GD/64805· CONTACT E-MAIL: infolacaixclaim(a)aol.es infolacax(a)mixmail.com
Sincerely,
Angel Sanchez Canovas (Mrs).
Online co-ordinator.
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.gking.harvard.edu/?info=clarify
Roseflush of the west fell over it, shining on gigantic body,
the huge massy face, seamed with.
How To Get A Girl To Do Anything And Everything In Bed - Be Absolutely MMind Blowing
<http://rachaelxubcu.livejournal.com/1263.html>
Floor, if the gentleman would she preceded him, a humility
as disturbing as it was complete. The can be formed so rapidly
that he had time to be a little tea party quite an informal
affair, some pleasing, became offended at the repulsive
conduct sparrows all roasted take the brawns from the about,
and it's pretty clear to me as i've never so, could ellis
have acted. You see? Said sir or online at gutenberg/license).
section 1. General heat. There seemed to be no air in the
forest, the from this point forkil. The river flowed with
say they do not worship wood or stone, but only.
Hay all-
I've see this issue addressed in a few previous posts, but I'm still unclear.
The long and short of my situation is that I did full matching in R. I
need to use ordered logit for my analysis, but as of right now Zelig
does not support the use of weights. So, I performed the analysis in
Stata with Clarify. The models come out fine, but I can't generate
substantive interpretations of the coefficients becuase simqi does not
appear to support the use of weights when generating predicted
probabilities.
Thoughts?
Best,
-c
--
Casey A. Klofstad
University of Miami
Department of Political Science
Coral Gables, FL
klofstad(a)gmail.com
http://www.as.miami.edu/personal/cklofstad/
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.gking.harvard.edu/?info=clarify