Re: nested logit #2

  • Permalink
  • submit to reddit
  • Email
  • Follow

Lee:I was writting for you.
Do you receb my comments? .
I was sending one idea for you problem.
I was working about that=2C and you said of residuals=2C I believe that is =
decision probability. I'm  thinking about that. How can  I graphic of decis=
ion probabillity?
Sandra Vergara> Date: Thu=2C 23 Oct 2008 16:13:46 -0400> From: lpanas@brand=> To: sa_vergara@HOTMAIL.COM> CC: SAS-L@LISTSERV.UGA.EDU> Subject: R=
e: nested logit> > Sandra=2C Thanks for your response. I also get red inste=
ad of blue on the utility statement. I don't think that means anything. Som=
etimes that happens with new procedures. > > Lee> > ----- Original Message =
-----> From: "sandra vergara cardozo" <sa_vergara@HOTMAIL.COM>> To: SAS-L@L=
ISTSERV.UGA.EDU> Sent: Thursday=2C October 23=2C 2008 3:11:15 PM GMT -05:00=
 US/Canada Eastern> Subject: Re: nested logit> > Lee=2C When you running of=
 program MDC=2C of the words utility appear red? or blue? In my case=2C app=
ear red? It=B4s wrong? Thanks> Date: Mon=2C 20 Oct 2008 19:42:46 -0200> Fro=
m: scardozo@ESALQ.USP.BR> Subject: [Fwd: nested logit.]> To: SAS-L@LISTSERV=
..UGA.EDU> > Lee:> > You need writte:> First:> need writting of same name os=
 variables (5):> personid =3Dtacl1> decision =3Dtacl2> topmode=3Dtacl3> mid=
mode =3D tacl4> mode =3D tacl5> > What is the variable Choice? male depress=
ion> > > data newdata1(keep=3Dpid decision mode tacl)=3B> set owl1=3B> arra=
y tvec{5} tacl1 - tacl5=3B> retain pid 0=3B> pid + 1=3B> do i =3D 1 to 5=3B=
> mode =3D i=3B> tacl =3D tvec{i}=3B> decision =3D ( choice =3D i )=3B> out=
put=3B> end=3B> run=3B> > proc mdc data=3Dnewdata1=3B> model decision =3D t=
acl / type=3Dnlogit choice=3D(mode 1 2 3 4 5 )> id pid=3B> utility u(1=2C) =
=3D tacl=3B> nest level(1) =3D (1 2 @ 1=2C 3 4 @ 2=2C 5 @ 3)=2C> level(2) =
=3D (1 2 @ 1=2C 3 @ 2)=3B> output out=3D owl1GL p=3D pdec1GL=3B> run=3B> > =
> data saida1=3B merge owl1GL=3B> e =3D tacln - pdec1GL=3B> proc print data=
=3Dsaida1=3B> run=3B> > And you can export of residuals for excel.> > I hop=
e help you.> > Sandra> > --------------------------- Mensagem Original ----=
------------------------> Assunto: nested logit.> De: "Lee Panas" <lpanas@B=
RANDEIS.EDU>> Data: Seg=2C Outubro 20=2C 2008 14:41> Para: SAS-L@LISTSERV.U=
GA.EDU> -------------------------------------------------------------------=
-------> > Hi=2C I am trying to use PROC MDC for a nested logit. My study i=
nvolves a> group of people with bipolar disorder. I am trying to predict dr=
ug> prescribed based on patient characteristics (age=2C gender=2Cetc) and c=
linical> status (depression=2C mania=2C etc.). All independent variables ar=
e individual> specific.> > At the bottom level=2C there are 5 choices for d=
rugs: 1=2C 2=2C 3=2C 4=2C 5. The> drugs are nested as follows: At mid level=
=2C there are three drug types: A> (1=2C2)=2C B (3=2C4)=2C C (5). At the to=
p level=2C there are two classes: X (A=2CB)=2C> Y (C).> > Here is part of m=
y data set:> > personid decision topmode midmode mode male depression> 1 0 =
1 1 1 1 0> 1 1 1 1 2 1 0> 1 0 1 2 3 1 0> 1 0 1 2 4 1 0> 1 0 2 3 5 1 0> 2 1 =
1 1 1 0 1> 2 0 1 1 2 0 1> 2 0 1 2 3 0 1> 2 0 1 2 4 0 1> 2 0 2 3 5 0 1> > My=
 problem is that it seems as if each indep variable can only occur once at>=
 each level. If they appear more than once=2C then SAS gives a parameter> e=
stimate but no standard error on the second occurrence. Is there any way> t=
o get SAS to print standard errors each time? Here is an example of my> SAS=
 code:> > proc mdc> model decision=3Dmale depression/type=3Dnlogit choice=
=3D(mode 1 2 3 4 5)=3B> id personid=3B> utility u(1=2C 1 2) =3D male depres=
sion> u(1=2C 3 4) =3D male depression> u(2=2C 1 2) =3D male depression> =3B=
> > nest level(1)=3D (1 2 @ 1=2C 3 4 @ 2=2C 5 @ 3)> level(2)=3D (1 2 @ 1=2C=
 3 @ 2)=3B> > Output:> > Parameter Estimate std err> > male_L1G1 -1.41 miss=
ing> depression_L1G1 2.61 3.89> male_L1G2 -1.31 1.56> depression_L1G2 2.48 =
missing> male_L2G1 2.02 5.94> depression_L2G1 -3.96 11.19> > Is there any w=
ay to get SAS to compute standard errors in the cases above> where it is mi=
ssing?> > Thanks=2C> > Lee> > > Sandra Vergara Cardozo> Doutoranda em Estat=
=EDstica> ESALQ/USP> Tel: (19)3429-4144> Ramal:233/235> > Express yourself =
instantly with MSN Messenger! MSN Messenger > _____________________________=
____________________________________> Express yourself instantly with MSN M=
essenger! Download today it's FREE!>

Express yourself instantly with MSN Messenger! MSN Messenger=20
Express yourself instantly with MSN Messenger! Download today it's FREE!
Reply sa_vergara (5) 10/23/2008 11:45:08 PM

See related articles to this posting 130616 articles. 24 followers. Post

0 Replies

Similar Articles

[PageSpeed] 56


Similar Artilces:

Re: Using MDC (Logit or Nested logit) on varying choice sets #2
--- David L Cassell <davidlcassell@MSN.COM> wrote: > ug97044@YAHOO.COM wrote: > >I want to use MDC to estimate a logit model in which each decision > maker > >has a different choice set. That is, the first individual has three > >choices, the second individual has five choices and so on. I only > know the > >maximum and the minimum number of choices possible. Can anybody give > me > >some advise on how to do this? > > > >Regards > >Anand. > > I have to wonder about your data first. I would use PROC MDC for a > multino...

Re: NDSolve[] with nested If[] and Piecewise[] usage: #2 #2
Hello Mathematica friends, Sometime back I posted this question on the usage of nested If[] and Piecewise[] inside NDSolve[]. I followed Oliver's reply and was able to solve that particular case. I also could solve another problem which is similar to the posted problem. But when I tried the same (like enclosing the expressions with Evaluate[]) on another notebook which has similar usage of nested If[], it did not work. I have included the code here, you can also notice that Piecewise[] also did not work here. Please give me your suggestions to solve this problem. Thank you. ...

Re: Nested macro string with nested quotes #2
Paul, You must hide the single quote marks with a quoting function in order to get what is inside resolved. Usually the quoted material is automatically unquoted when passed to the compiler. However, quote marks are an exception, they must be explicitly unquoted in pairs. Use %unquote(%str(%')[ACTIVATE("Kids&FY1..xls")]%str(%')) -----Original Message----- From: Paul Choate [mailto:pchoate@DDS.CA.GOV] Sent: Monday, July 28, 2003 12:36 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Nested macro string with nested quotes Hi all, I am trying to crea...

Re: Manually nested Tables faster than builtin nesting? #2
Bill Rowe wrote: > On 10/27/10 at 5:13 AM, (Sebastian > Schmitt) wrote: > >> I find that manually nested Tables are faster (factor 2 in my >> example) compared to the builtin nesting. I probably do a stupid >> thinko. Could you please have a look? > >> In[52]:= imax = jmax = 5000; > >> In[53]:= (tabletable = Table[Table[i*j, {i, imax}], {j, jmax}];) // >> Timing // First > >> Out[53]= 1.84 > >> In[54]:= (table = Table[i*j, {i, imax}, {j, jmax}];) // Timing // >> Firs...

Re: Using MDC (Logit or Nested logit) on varying choice sets
ug97044@YAHOO.COM wrote: >I want to use MDC to estimate a logit model in which each decision maker >has a different choice set. That is, the first individual has three >choices, the second individual has five choices and so on. I only know the >maximum and the minimum number of choices possible. Can anybody give me >some advise on how to do this? > >Regards >Anand. I have to wonder about your data first. I would use PROC MDC for a multinomial discrete choice model. But I would NOT feel comfortable taking data where Person #1 has choices 1,2,3 and Person #2 has choice...

Re: Using MDC (Logit or Nested logit) on varying choice sets #3
I was a bit too quick with my previous response. To fit a multinomial discrete choice model with NLMIXED where each selection has its own set of covariates, the data must be structured in wide form with all brand-specific information in a single record. Thus, for the yogurt data where there are up to four brands and each brand has its own price and feature values, we would require a data set with brand selected (whether Yoplait, Dannon, Weight Watchers, or local brand), price for each brand, feature status for each brand, and a choice set variable. As before, let BRAND take on the value 1 f...

Re: Nested if-then-do #2
Dave: When I copied the raw data to SAS Editor, the raw data looks fine. Ignore some request about input in the last email but still let me know your desired result. J S Huang 1-515-557-3987 fax 1-515-557-2422 >>> dave crimkey <d_crimkey@YAHOO.COM> 2/4/2006 10:46:08 AM >>> I'm trying to run through a dataset and count cases where the "types" are the same. I have four types that I'm looking through and when any one of the types is the same as any of the other types its counted as two counts (two types are the same). If three types are the same it...

Re: nested logit
Lee=2C When you running of program MDC=2C of the words utility appear red? = or blue? In my case=2C appear red? It=B4s wrong? Thanks> Date: Mon=2C 20 Oc= t 2008 19:42:46 -0200> From: scardozo@ESALQ.USP.BR> Subject: [Fwd: nested l= ogit.]> To: SAS-L@LISTSERV.UGA.EDU> > Lee:> > You need writte:> First:> nee= d writting of same name os variables (5):> personid =3Dtacl1> decision =3Dt= acl2> topmode=3Dtacl3> midmode =3D tacl4> mode =3D tacl5> > What is the var= iable Choice? male depression> > > data newdata1(keep=3Dpid decision mode t= a...

Re: Logit help #2
I will get the data in a more manageable format. The * showed up after pasting the code somehow, they are not in the actual program. The by statement, like you said, will only do analysis per race. This is not informative unless u can combine all the information for all the races. I will look into these other procedures. I have limited understanding of mixed models. NON in sas. I may need to hit the text books again. :S Definitely did not think it was going to be easy, but it is an enjoyable task. I am calling it quits today but will let you know what thoughts I have tomorrow, Thanks...

Re: Nested Functions #2
On 12/3/03 at 4:24 AM, (Gregory Lypny) wrote: > I'm a relatively new user of Mathematica. I've got a problem with a > nested function that won't evaluate when supplied with numbers. It > looks something like this: MU is a function nested within another > function P. > MU[C_] = C^g, where 0<g<1 (g=.25 in my notebook) > and > P[z_, Cs_, C0_] = z (MU[Cs]/MU[C0]) > When I try to evaluate P[.5, 120, 90] I get the same input returned, > that is, P[.5, 120, 90], rather than the value of the function P ...

Re: generalized logit? #2
Dennis, A late-in- the day response: there are two versions of a Wald test. One method tests the overall significance of a variable (a matrix version which SAS prints the results for categorical covariates for more than two levels). There is also the single degree of freedom test for each coefficient. The disadvantage of the latter is that for large values of the coefficient, the estimated standard error is inflated, resulting in "wide" confidence intervals that manifest themselves in the idiosyncracy you describe (this is the case for binary data, and I assume affects nominal resp...

Re: nested logit #3
Sandra, I received your comments. Thank you. I still can not put the same independent variable on two different alternatives. Maybe, this can not be done in MDC. I don't know about decision probability. Can you output the residuals and then use proc plot? Lee ----- Original Message ----- From: "sandra vergara cardozo" <> To: Cc: Sent: Thursday, October 23, 2008 7:45:08 PM GMT -05:00 US/Canada Eastern Subject: RE: nested logit Lee: I was writting for you. Do you receb my comments? . I was sending one ...

Re: Nested Grids #2
If it were just a matter of coloring, you could flood fill the item using Item[] as follows... Grid[{{Item[Grid[{{a, b}, {c, d}}, Frame -> All], Background -> Orange], e}, {f, g}}, Frame -> All] And there are a few other things you can do with Item[] as well. Things inside a grid element don't get to control anything outside the margins provided for them by the parent grid, but Item[] does let you control some things all the way out to and including the divider lines immediately around the item. But you're right. There is no way to push those inner Gri...

Re: SAS nested do loops #2
I'm not sure exactly but it sounds like you want to assign the strata values(1:54) to you data base on the values of a b c d. That sounds like a lookup operation to me. Assuming that is correct this program may be of some use. proc plan ordered; *Create look up table; factors a=2 b=3 c=3 d=3 stratum=1 of 54 perm / noprint; output out=work.stratum(index=(stata=(a b c d))); run; proc print; run; data test; *Now look up the strata; input a b c d; call missing(stratum); set work.stratum key=stata / unique; if _iorc_ gt 0 then _error_ = 0; cards; 1 3 2 1 1 2 1 3 3...

Re: Sorting nested list #2
On 5/27/05 at 4:56 AM, (plizak) wrote: >I have a similar problem, I need to sort the same kind of list >{{a,{2,4,1.,...}}, {c, {1,2,...}},{b,{3.2,-2,.≠..}}} >but I need to sort it based on the first element of each subarray, >while keeping the second element the same. >I did a pretty ugly solution (like 12 lines of code). Is there a >quicker more elegant way to sort this? Is this what you want? In[8]:= data = {{a, {2, 4, 1.}}, {c, {1, 2}}, {b, {3.2, -2}}}; Sort[data, OrderedQ[{#1[[2,1]], #2[[2,1]]}] & ] Out[9]= {{c, {1, 2}}, {a...

Re: nested macros definitions #2
Michael, When it comes to macro resolution, I have to leave your question for some of the list's more macro knowledgeable members. However, that said (and not asking why you need nested macros), wouldn't something like the following work as you wish? %global year; data one; x=1; run; %macro outer(theyear); %let year=&theyear; %macro inner; title "Inner Statistics for year &year"; proc print; run; %mend inner; %inner title "Outer Statistics for year &year"; proc print; run; %mend outer; %outer(2005) A...

Re: Mixed Logit HELP!!! #2
I think MDC is what you want based on the online documentation under SAS/ETS. Here is what it says: The MDC (Multinomial Discrete Choice) procedure analyzes models where the choice set consists of multiple alternatives. This procedure supports conditional logit, mixed logit, heteroscedastic extreme value, nested logit, and multinomial probit models. A copy of the documentation when it was experimental is available here: -----Original Message----- From: [] On Behalf Of cathy Sent: Th...

Re: Generalized logit model? #2
Dan, Here is my code PROC LOGISTIC ; model DrugFreq(ref='Both MA and Viagra') = white bedrgd bedrgc bedrgh edt gegmhs sexpref hhltha hhlthb hhiv fsexpf alive3 bedrgia bedrgic/ link = glogit ; RUN; According to SAS FAQ#953 having the statement model y(ref='1') = ,your model effects.; will cause the following generalized logits to be modeled: log(p2/p1) log(p3/p1) There should be an option so that you can get log(p1/p2) log(p1/p3) That is what I do not know how to do. Thanks. Dennis Nordlund, Dan (DSHS/RDA) wrote: >> -----Original Message----- >> From: S...

Re: multinomial logit model
Lene, I am working on a response from an earlier post. The problem that you present is not a simple statistical analysis. That is, it cannot be handled by standard procedures. This reply is just to give you a heads up that there will be more to come. But it might take a little while to complete my other response. Dale --- Lene Blenstrup <lenetb@SOCSCI.AAU.DK> wrote: > I’ll try again – this time under a different heading.. > > Can anyone tell me how to do a multinomial logit model as this seems > to be > the way to make discrete time hazard models with competing ris...

Re: Problem with Nested Macros #2
sa polo, %macro test(yymm=) ; %local FirstDate ; %let FirstDayOfMonth = %sysfunc(inputn(&yymm.01,yymmdd10.)) ; data _null_ ; LastDayofMonth = intnx('MONTH',&FirstDayOfMonth,0,'END') ; do i = &FirstDayOfMonth to LastDayofMonth ; start = intnx('Day',&FirstDayOfMonth,i) - &FirstDayOfMonth ; if (2 le weekday(start) le 6 ) then do ; xx = put(start,YYMMDDN8.) ; yy = compress('flags_fiveT1A_'||xx||'.csv') ; put xx= ; end; end; run; %mend ; %test(yymm=200503) ; HTH Toby Dunn From: sa polo <solouga2@REDIFFMA...

Re: Nesting functional commands #2
On 9/1/09 at 3:51 AM, (Erin Noel) wrote: >So how would you go about nesting a functional command inside of >another functional command? For example, say A={1,2,3,4}, then >3*#&/@A = {3,6,9,12}. No problem. But then what if, within that >vector {3,6,9,12}, I wanted to use the Select command to choose >elements less than, say 7. The command Select[3*#&/@A,#<7&] doesn't >work because, as far as I can tell, Mathematica doesn't know which >"#" belongs to Select and which "#" belongs to the &/@ mapping over...

Re: interpretation: multinomial logit #2
Hi, Could you please send me your paper? I am forming my research question. I wanted to read stuff on the method, first. I am sure that your paper would greatly be helpful to me. Thanks, Duckhye >>> Peter Flom <flom@NDRI.ORG> 02/02/05 12:52 PM >>> Multinomial is kind of hard to interpret, sometimes. The problem is that you get a lot of parameters estimated, especially if the dependent variable has many levels I recently gave a talk at the NY Areas SUG on ordinal and multinomial logistic; I can forward it to you, seperately, if you like. However, one should not choo...

Re: gettting out of the nested loop #2
Hi Philip, Due to the infinite number of possibilities of how people want to use loops or the number of loops, the internal programming language mechanics with loops-stacks, etc. plays a slight role. ...way to much to say that it merely takes 2 or 3 small simple things in conjunction to fit the specific situation. Most languages (most modern day languages) do pretty well breaking out of loops and doing the necessary internal clean up (when they are told that it needs to be done). However, if you have thousands or millions of interations and jump out of the middle of a loop, you are spec...

Re: Nested Data Accesses? #2
On Fri, 16 May 2008 13:09:16 -0700, Laptop765@GMAIL.COM wrote: >Hello. I'm relatively new to SAS but have a pretty good understanding >of it. There's a lot to understand. More below. >I am having difficulty with something... I have: >data temp; >set olddata; >%getnum(param) >var1=&val1; >var2=&val2; >run; > >getnum is a macro whose contents are a proc sql to grab the values >that I need to use to update temp. SAS claims that var1 and var2 are >invalid statements or out of place (error 180-322). After much >debugging I discovered ...