```Date: Mon, 25 Nov 2002 09:26:38 -0800 Reply-To: Dale McLerran Sender: "SAS(r) Discussion" Comments: To: wly From: Dale McLerran Subject: Re: Need help on nested logit model!! In-Reply-To: <7a5ed11d.0211240030.1e497974@posting.google.com> Content-Type: text/plain; charset=us-ascii The following datastep will construct a dataset which can be passed into the MDC procedure. data newdata; set olddata; array choices {4} brand1-brand4; array pricebrand {4}; id = _n_'; do brand=1 to 4; select = choices{brand}; price = pricebrand{brand}; output; end; keep id select brand price; run; The result will be a dataset which looks like this: ID SELECT BRAND PRICE 1 1 1 3 1 0 2 4 1 0 3 1 1 0 4 2 2 0 1 ... 2 ... 2 ... 2 ... 3 ... 2 ... 4 ... As far as providing you detail as to how to construct the code for the MDC procedure, I prefer to allow students to look at the documentation and puzzle over things for a while, consult with other students as the situation warrants, or confess to their professors that they just don't know how to complete the assignment and would the professor be so kind as to spend a little time clarifying some confusion or suggest what the student might look at to get a better understanding of how to proceed. I will point you to the online PDF documentation for the MDC procedure: http://www.sas.com/rnd/app/papers/mdc.pdf The online PDF documentation for the QLIM procedure is at: http://www.sas.com/rnd/app/papers/qlim.pdf By the way, I was not aware of the (relatively) new MDC or QLIM procedures, and so I searched the SAS web site for these keywords. It took me all of 5 minutes to perform the search and read enough of the documentation to answer the first of your questions. I have fitted my own multinomial discrete choice models in the past, and know enough about the structure of such models that it did not take me long to review the documentation. I would caution that the MDC procedure does not allow you to fit models in which there are multiple instances of the response for each subject, but I don't think that you will be getting into such complexities right away. Dale --- wly wrote: > hi,there, > i got a data arranged as the following form: > > brand1 brand2 brand3 brand4 pricebrand1 pricebrand2 pricebrand3 > pricebrand4 > 1 0 0 0 3 4 1 2 > 0 . . . . . . . > . . . . . . . . > > because it seems to me that it's very diffcult to rearrange this data > for the form needed in SAS, anybody can tell me how to do that and > analysis this daat with PROC MDC or PROC QLIM ?? examples in detail > will be deeply appreciated! > > thanks a lot!! ===== --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@fhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 --------------------------------------- __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus – Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ```

Back to: Top of message | Previous page | Main SAS-L page