Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
statalist-digest <owner-statalist@hsphsun2.harvard.edu> |

To |
<statalist-digest@hsphsun2.harvard.edu> |

Subject |
st: statalist-digest V4 #3716 |

Date |
Tue, 2 Mar 2010 02:33:06 -0500 |

statalist-digest Tuesday, March 2 2010 Volume 04 : Number 3716 ** Send unsubscribe or help commands to majordomo@hsphsun2.harvard.edu ** The digest contains: st: uninstall a command Re: st: uninstall a command st: RE: RE: re: xtivreg2 - Incomplete computation of first stage regression st: RE: controlling display formats in macros st: lags with multiply imputed panel data st: bootstrap in factor analysis st: Re: R for Stata Users st: AW: bootstrap in factor analysis st: I need help with Extreme Bound Analysis st: Tests of overidentifying restrictions after xtivreg2 st: using spmap and option "point" Re: st: Calculate individual distance from other group members Re: st: re: Solving the moving average in the error structure in a panel data fe st: estimating production function st: AW: Tests of overidentifying restrictions after xtivreg2 st: Competing Risk for repeated event nominal dependent variables st: testing a model st: Sign of Lambda in heckman Re: st: Scandinavian letters in Stata st: AW: testing a model st: AW: Sign of Lambda in heckman st: Ana Timberlake obituary Re: st: testing a model Re: st: Repeated time values within panel in levpet STATA output Re: st: lags with multiply imputed panel data RE: st: lags with multiply imputed panel data st: Missing data on outcome and sample selection bias st: AW: AW: testing a model st: Endogenous Regressors Predicted by the Same IV re: st: Tests of overidentifying restrictions after xtivreg2 re: st: re: Solving the moving average in the error structure in a re: st: Endogenous Regressors Predicted by the Same IV st: RE: Missing data on outcome and sample selection bias Re: st: RE: Missing data on outcome and sample selection bias Re: st: re: Solving the moving average in the error structure in a re: st: re: Solving the moving average in the error structure in a st: FAQ reminders st: Panel LM Unit Root Test with Heterogenous Structural Breaks Re: st: re: Solving the moving average in the error structure in a st: Text editor that has automatic table of contents? st: Fwd: Saving results in program/loop st: RE: Text editor that has automatic table of contents? re: st: Fwd: Saving results in program/loop st: RE: Text editor that has automatic table of contents? Re: st: Endogenous Regressors Predicted by the Same IV st: vector with weighted observations question st: expected values after xtpcse st: RE: I need help with Extreme Bound Analysis Re: st: Text editor that has automatic table of contents? st: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering st: RE: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Re: st: expected values after xtpcse Re: st: lags with multiply imputed panel data Re: st: lags with multiply imputed panel data st: RE: AW: bootstrap in factor analysis st: RE: Text editor that has automatic table of contents? st: Question on survey data analysis st: RE: RE: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Re: st: using spmap and option "point" ---------------------------------------------------------------------- Date: Mon, 1 Mar 2010 03:37:08 -0500 From: Nirina F <fstata@gmail.com> Subject: st: uninstall a command Hello, I installed cmp through ssc install ghk2, replace ssc install cmp Could you please let me know how to uninstall it? Thank you, Nirina * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 03:40:18 -0500 From: Nirina F <fstata@gmail.com> Subject: Re: st: uninstall a command never mind Folks, I did -ssc uninstall- and it worked. Thank you On Mon, Mar 1, 2010 at 3:37 AM, Nirina F <fstata@gmail.com> wrote: > Hello, > I installed cmp through > ssc install ghk2, replace > ssc install cmp > Could you please let me know how to uninstall it? > Thank you, > Nirina > * > * ï¿½ For searches and help try: > * ï¿½ http://www.stata.com/help.cgi?search > * ï¿½ http://www.stata.com/support/statalist/faq > * ï¿½ http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 16:56:15 +0800 From: "Lim Boon Leong" <lboonl@streamyx.com> Subject: st: RE: RE: re: xtivreg2 - Incomplete computation of first stage regression Dear Mark, Kit et al., After trying out your methods to fix the problem, it really works. Really thank you very much for your kind assistance. Next I am going to check the problem of misspecification of equation as suggested by Kit. Best regards, Lim Boon Leong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Sun, 28 Feb 2010 13:22:55 -0600 From: "Richard T. Campbell" <dcamp@uic.edu> Subject: st: RE: controlling display formats in macros Many thanks to Kit Baum, Eric Booth and Martin (or is it Maarten?) Weiss who provided a quick response to my query regarding macros in graph titles. Works like a charm and I learned a bit more about Stata. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Richard T. Campbell Institute for Health Research and Policy University of Illinois at Chicago, M/C 275 1747 W. Roosevelt Rd. Chicago, IL 60608 312-413-0480 http://www.ihrp.uic.edu/. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Sun, 28 Feb 2010 13:51:53 -0500 From: Daniel Miller <danielpmiller@gmail.com> Subject: st: lags with multiply imputed panel data - --001636e1f95a4908b60480ada0fd Content-Type: text/plain; charset=ISO-8859-1 Hello all ---- I had posted this once already with no replies, and thought I would give it one more shot: I am having trouble getting Stata to implement lags (using the L. command) on my dataset of multiply imputed panel data. I reshaped the data from wide form to long form in the following way: gen i =_mi mim, cat(manip) sortorder(idnum i): xtset idnum wave where idnum is the unique identifier for respondents and wave is the time variable (4 time points). In browse view, the data look like: *_mj _mi i idnum wave* 1 1 1 1000001 1 1 2 2 1000001 2 1 3 3 1000001 3 1 4 4 1000001 4 2 1 1 1000001 1 2 2 2 1000001 2 2 3 3 1000001 3 2 4 4 1000001 4 .......................... 5 5 5 1000001 4 When I try to use a lagged treatment variable, I get an error message: e.g. mim: xtreg fwork l.ratecata1, fe - -> _mj==1 - -> xtreg fwork l.ratecata1, fe not sorted r(5); Clearly, the data are not sorted properly, but I am unable to find the proper sort order. I am able run any lag command on the imputed datasets individually by sorting like this: sort idnum wave but combining the results from each dataset is tedious and am hoping for some insight on how to fix the problem. thank you so much in advance, Daniel Miller Assistant Professor Boston University School of Social Work * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --001636e1f95a4908b60480ada0fd-- ------------------------------ Date: Mon, 1 Mar 2010 11:21:02 +1300 From: Thu Phuong Truong <Phuong.Truong@vuw.ac.nz> Subject: st: bootstrap in factor analysis Dear Martin and statalister, Thank so much for getting back to me. I am sorry that I did not make it clear in my previous email. I could do bootstrap for regression. However, I have trouble with factor analysis as I do not know what I should include in the exp_list. For example bootstrap exp_list, reps(1000): factor reform_index analyst_index herfindahl5_index ceochair_index brdsize_index brdindp1a ac_index if firmyeartestqualified==1, pcf What should I include as exp_list in order to test whether the factor loadings are significantly from zero? Thank so much for your help. Yours sincerely, Phuong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Sun, 28 Feb 2010 09:05:30 -0700 From: Joseph Hilbe <j.m.hilbe@gmail.com> Subject: st: Re: R for Stata Users - --000e0cd649643c27940480ab4d75 Content-Type: text/plain; charset=ISO-8859-1 StataListers: I sent this message on Saturday, but it did not go through. I believe I must have been using a rich text editor, which Statalist does not accept. I tried again this morning, but recalled that i have gmail, which is pure text. I am sending it through gmail in case aol still does not go through. If you get this twice, my apologies. - ------ I am not on the Statalist, but do take the Digest, so do not get the listings until the following day. Most of the time I try to see what has been discussed, sometimes i just don't have the time. Fortunately I looked this morning. Bob Muenchen of the Univ of Tennessee wrote a book a couple of years ago titled "R for SAS and SPSS users" The folks at both SPSS and SAS have seemed to love it, once they realized that the book was aimed to help SAS/SPSS users who also wanted to learn R. It was not written to convert anyone from SAS/SPSS to R. Bob is a SAS user and has no intention of changing. The statistics editor at Springer contacted me about working with Bob for a book to be titled "R for Stata Users" He knew that I added R code at the end of the chapters of my then recently published "Logistic Regression Models" (May 2009, Chapman & Hall/CRC) which - insofar as it was possible - was aimed to produce output corresponding to the Stata examples I use throughout the text. I initially did this to assist members of my classes with Statistics.com. I teach Logistic Regression and Advanced Logistic Regression, as well as a couple of other courses for them. Nearly all "students" are professors who teach statistics courses in some discipline, or active researchers wanting to update their knowledge of certain area of statistics. Many -- perhaps even most -- of these students use R, with SAS as the next most common sofware of preference. Very few come to class as Stata users. From the feedback I get however, many of these students are so impressed with what Stata can do that they end up as Stata users after the class is over. They most definitely end up respecting Stata for its scope of capabilities and ease of use. I have a 30 page tutorial on Stata as Appendix A to help these students, and provide references to other places where they can learn Stata, including the suite of Stata Press books. Man times I have to tell them that there simply is no corresponding SAS, SPSS, or R function available for some procedure we are discussing. It is clear in Logistic Regression Models that Stata has for more modeling capabilities in this area than is available in R. I have a couple of my later chapters which have no R examples at the end of chapter, eg the chapter on exact logistic regression. But there are areas in which someone has posted a library of functions to CRAN that is not available in Stata; eg wavelets. I needed to write a NB2-NB1 hurdle model for a project a week ago. Stata does not have a command for it, and I or anyone else I know has not written one, but it is available using the flexmix function in R. This does not happen much, but it can happen to any of us. Now - to address the questions raised. I joined the project with Bob because it is clear from email I get, from students and other profs I relate with, and from what I see myself, that many - perhaps most - textbooks now being published use R for examples. R is free and is not a commercial package. Many university stat departments are now requiring that their students learn R. And, from what I see being on the editorial boards of 7 journals now, most examples used in Journals employ R. What does this mean? Well, as a long time committed Stata user (some 22 years now) it means that if I am going to get the most from textbooks using R for examples, and if I am to better understand articles using R for examples, then I want to understand the basics of R. If I am to better help my R-using students to understand the Stata code and examples I use in my books, I should know R so that i can use it to teach them how to understand Stata and the examples. But there are some models that are not yet available in Stata, but are available in R. I didn't write the cover -- but the purpose of the book is to help Stata users learn enough R to 1) better understand texts and journal articles employing R for examples, and 2) to better be able to use R for the estimation of statistical procedures that are currently unavailable in Stata. This includes how to set up variables/observations, deal with missing values, and so forth. I can't imagine anyone actually switching from Stata to R, unless they simply have no money to purchase the software and do not have access to a university site license. there is nowhere in the book that advocates such a change. In fact, for portions of the book that I wrote, I compare Stata code with R code for doing some operation or functions. Mostly Stata is easier - but sometimes not. I myself find it much easier to use Stata than R for most commands and operations. I too had trouble with the R "if"operator - because there isn't any. this was difficult for me at first, but there are ways to perform the operation that end up not so bad at all. However, Stata is more direct. The foremost area of instruction in "R for Stata Users" is perhaps data management. This is the area that is most difficult for Stata users trying to interpret R code that is presented in a text or article. There are two chapters on graphics and one on basic statistical commands, but nothing beyond linear regression and ANOVA. The book is NOT for Stata users who have no reason to learn R. If it were not for me having so many students who are R users and having to present materials aimed to teach various statistical methods, and if I did not want to better understand texts and journal articles that use R, I would have no reason at all for learning it. Also, I referee more articles than I have time for, in addition to my AE responsibilities, and find that the majority of manuscripts I get use R for their examples. In order to do a more responsible job as referee I felt that I needed to learn R. But that has no bearing on what my preferred statistical package is for my own work. It is clearly Stata - for a host of reasons. But I still find it useful to know R as well. And that is the point of the book. The book was written for those wanting to augment Stata, or to better understand sources that use R for examples. I have found learning R useful at times, you may as well. Joseph Hilbe * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --000e0cd649643c27940480ab4d75-- ------------------------------ Date: Mon, 1 Mar 2010 14:07:42 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: AW: bootstrap in factor analysis <> Type -ereturn list- after the factor command to see the available returned results: ************* webuse bg2, clear factor bg2cost1-bg2cost6, factors(2) pcf eret li ************* HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Thu Phuong Truong Gesendet: Sonntag, 28. Februar 2010 23:21 An: statalist@hsphsun2.harvard.edu Betreff: st: bootstrap in factor analysis Dear Martin and statalister, Thank so much for getting back to me. I am sorry that I did not make it clear in my previous email. I could do bootstrap for regression. However, I have trouble with factor analysis as I do not know what I should include in the exp_list. For example bootstrap exp_list, reps(1000): factor reform_index analyst_index herfindahl5_index ceochair_index brdsize_index brdindp1a ac_index if firmyeartestqualified==1, pcf What should I include as exp_list in order to test whether the factor loadings are significantly from zero? Thank so much for your help. Yours sincerely, Phuong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Sun, 28 Feb 2010 21:40:46 -0600 From: Kwame <kwa-me@live.com> Subject: st: I need help with Extreme Bound Analysis - --_a1550739-25fb-4388-a931-70162ff4dd94_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Dear Statalist Veterans: I am new to Stata but have a project requiring eba (Extreme Bound Analysis). The equation I am estimating is in the form: Y =3D a +BiI+BmM+BzZ+u =20 Y is the dependent variable=20 I is the vector of free variables (one variable in the present) M is a vector of four variables of interest Z is a vector of control variables (ten in this case) I want Stata to take tow Z variables in each combination (with the I variable and one M var= iable) but have been getting syntax errors as I try. Below are two questions I=92d like you to help me with bas= ed upon what I=92ve explained above:=20 What is the correct command to run the model for each of the variables(M)of interest?Is it possible to run eb= a for all the four variables of interest with a single command and if so what will i= t be? I appreciate any help you can offer me with this. Kwame * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --_a1550739-25fb-4388-a931-70162ff4dd94_-- ------------------------------ Date: Mon, 1 Mar 2010 20:48:24 +0800 From: "Lim Boon Leong" <lboonl@streamyx.com> Subject: st: Tests of overidentifying restrictions after xtivreg2 This is a multipart message in MIME format. - ------=_NextPart_000_0001_01CAB980.898A11C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Dear Statalisters, I have estimated the following equation by using xtivreg2, gmm function: xtivreg2 lsalary ceodual ........ (ownexr ownex2r ownex3r L.ldiv L.debt=lrisk ..., fe gmm cluster(id) small ffirst The test results turn out fine. But when I continue with the xtoverid test after the above estimation, xtoverid, cluster(id) the following error message appears: xtoverid error: internal reestimation of eqn differs from original r(198); I read the help file of xtoverid and it is mentioned that it supports xtivreg2. May I know what is the problem and how to fix it? Thank you very much in advance. Best regards, Lim Boon Leong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - ------=_NextPart_000_0001_01CAB980.898A11C0-- ------------------------------ Date: Mon, 1 Mar 2010 03:35:47 -0500 From: "Vitorino, Maria Ana" <vitorino@wharton.upenn.edu> Subject: st: using spmap and option "point" Dear statalist users, Is the following possible? I have 2 files: *file1 is something like: region populationsize id A ... 1 B ... 2 C ... 3 (I also have a file with the region coordinates so that I can use spmap) *file 2 is something like: store_id xcoord ycoord 100 ... ... 201 ... ... 345 ... ... 411 ... ... 544 ... ... I would like to do a map with the stores superimposed on the map but only for the stores that are located in region B or C (note that I don't have that information on file2, otherwise it would be easy to do), excluding store 345 (irrespective of where it is located). If I do something like the following, the problem is that all the stores (even the ones that are not located in regions B or C) show up...and I only want the ones located in regions B or C. spmap populationsize if region=="B" | region=="C" using file1coord, id(id) point(data("file2.dta") xcoord(xcoord) ycoord(ycoord) fcolor(emerald) select(drop if store_id==345)) How can I modify this command line to achieve what I'm looking for? Any help is appreciated. Thanks! Ana * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 13:31:17 +0100 From: Kartika Sari <kartika.sj@gmail.com> Subject: Re: st: Calculate individual distance from other group members - --000e0cd76222fa983d0480bc6c03 Content-Type: text/plain; charset=ISO-8859-1 Dear Austin, Thanks a lot for your help. The problem is solved. I used the joinby command to first create the pair. and then merge with the distance. Best regards, Kartika 2010/2/24 Austin Nichols <austinnichols@gmail.com> > Kartika Sari <kartika.sj@gmail.com>: > Like so, then? > > clear all > input gid id ward d1 d2 d3 d4 d5 > 1 1 3 10 4 0 9 7 > 1 2 1 0 6 10 8 5 > 1 3 2 6 0 4 11 3 > 1 4 1 0 6 10 8 5 > 1 5 2 6 0 4 11 3 > 2 1 3 10 4 0 9 7 > 2 2 1 0 6 10 8 5 > 2 3 2 6 0 4 11 3 > end > qui forv i=1/7 { > g i`i'=. > } > bys gid (id): assert id[1]==1 > bys gid (id): assert id==id[_n-1]+1 if _n>1 > qui forv i=1/7 { > bys gid (id): replace i`i'=d`=ward[`i']' if ward[`i']<. > } > l, noo > > See also > http://www.stata.com/support/faqs/data/members.html > (though it has some weird editing-induced typos e.g. "We have seen > that for some problems there is an advantage in using integer > identifiers which run from 1 and above within each group. If such > identifiers do not exist, they can be created, as seen in section 5.") > > On Tue, Feb 23, 2010 at 4:28 PM, Kartika Sari <kartika.sj@gmail.com> > wrote: > > Yes, the assert stop the calculation. > > I tried not to use assert to see what will happen, and try several > > combination, but off course, it didn't work. > > > > so the variables I have: > > > > for each individual: GroupID MemberID (1 to 7) WardID (1 to 74) Ward_1 > > Ward_2 etc Ward_74 that shows distance from ward where the person live to > > other 73 wards (0 for the ward he live in). > > > > But, sometimes member of group are only 2 or 3. > > > > Any suggestions? > > > > thanks in advanced > > Kartika > > > > 2010/2/23 Martin Weiss <martin.weiss1@gmx.de> > > > >> > >> <> > >> > >> " and for the Group, it is not uniform at 5, it is from 1 to > >> 7." > >> > >> > >> Are the ids within the wards contiguous, i.e. 1,2,3,4? If not, the > -assert- > >> line in Austin`s code will stop Stata. > >> > >> > >> > >> > >> > >> HTH > >> Martin > >> > >> > >> -----Original Message----- > >> From: owner-statalist@hsphsun2.harvard.edu > >> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Kartika Sari > >> Sent: Dienstag, 23. Februar 2010 21:46 > >> To: statalist@hsphsun2.harvard.edu > >> Subject: Re: st: Calculate individual distance from other group members > >> > >> Austin, > >> Thanks for your reply. Yes, i would like to have something like that. > >> > >> But, its turn out the actual data is more complicated than the > hypothetical > >> I made before. > >> I have 74 wards. and for the Group, it is not uniform at 5, it is from 1 > to > >> 7. > >> > >> So? > >> > >> Best regards, > >> Kartika > >> > >> > >> 2010/2/23 Austin Nichols <austinnichols@gmail.com> > >> > >> > Kartika Sari <kartika.sj@gmail.com>: > >> > Like so? > >> > > >> > clear all > >> > input gid id ward d1 d2 d3 d4 d5 > >> > 1 1 3 10 4 0 9 7 > >> > 1 2 1 0 6 10 8 5 > >> > 1 3 2 6 0 4 11 3 > >> > 1 4 1 0 6 10 8 5 > >> > 1 5 2 6 0 4 11 3 > >> > end > >> > forv i=1/5 { > >> > bys gid (id): assert id[`i']==`i' > >> > bys gid (id): g i`i'=d`=ward[`i']' > >> > } > >> > l, noo > >> > > >> > On Tue, Feb 23, 2010 at 11:22 AM, Kartika Sari <kartika.sj@gmail.com> > >> > wrote: > >> > > Dear All, > >> > > > >> > > In my data, I have a distance matrix of wards for each individual. > I > >> > also > >> > > know in which ward they live. The problem is i want to calculate > ward > >> > > distance from each individual to each of other members in a group. > Say > >> > there > >> > > are 5 people in a group, so I need to calculate distance for 4 > others > >> for > >> > > each person. I am wondering whether there is any syntax for this. > >> > > > >> > > The structure of data is something like this: > >> > > > >> > > group_id individual_id ward dtoward1 dtoward2 dtoward3 dtoward4 > >> dtoward5 > >> > > distance1? distance2? distance3? distance4? > >> > > 1 1 3 10 4 0 9 7 > >> > > 1 2 1 0 6 10 8 5 > >> > > 1 3 2 6 0 4 11 3 > >> > > 1 4 1 0 6 10 8 5 > >> > > 1 5 2 6 0 4 11 3 > >> > > > >> > > Thank you very much in advanced. > >> > > > >> > > Best regards, > >> > > Kartika > >> > > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --000e0cd76222fa983d0480bc6c03-- ------------------------------ Date: Mon, 1 Mar 2010 12:50:13 +0100 From: Carolina Lennon <carolina.lennon@gmail.com> Subject: Re: st: re: Solving the moving average in the error structure in a panel data fe - --00504502cffe279ad30480bbda82 Content-Type: text/plain; charset=ISO-8859-1 Thank you for the your response! as usual, it was very fast! I have another question related to my previous email (see below). You suggested to use "xtivreg2, fe with options robust bw(5)" in order to obtain statistics robust to heteroskedasticity and to the autocorrelation generated by the 4 lags in my overlaping sample (of data calculated using 5 years). I am currently using this method!!! But now, I would like to correct the bias in the "estimates" (the coefficients) generated by the MA error structure. I was wondering If I can use xtslg. Though, xtslg has not the option bw(5) and I am not sure how to set up the within panel correlations. In particular, I am not very sure how to set up the corr(corr) and rhotype(calc) options. If you can advise me in this respect I would really appreciate it! Many thanks Carolina 2010/2/22 Kit Baum <baum@bc.edu> > <> > Carolina wrote > > I am working with a fixed effect model. > My dependent variable is the sd of the growth rate of countries GDPs, > calculated over a period of 5 years. The explanatory variables are in > standard deviation as well and they are calculated over the same period of > years. > > I would like to use the overlapping sample ideally using fe estimation, > though for that I would need to correct for the outocorrelation generated > by > the moving average! > > That said, do you know if STATA has an option to correct this problem for > panel data! Ideally for fixed effect estimations? > If there were not, it is possible to program a new tipe of VCE matrix > (adjusting by the number of data overlaps)? > > > ssc desc xtivreg2 > ssc inst ivreg2 > ssc inst xtivreg2 > ssc inst ranktest > > Use xtivreg2, fe with options robust bw(5) to take care of the MA(4) in > your overlapping data. > > Kit Baum | Boston College Economics & DIW Berlin | > http://ideas.repec.org/e/pba1.html > An Introduction to Stata Programming | > http://www.stata-press.com/books/isp.html > An Introduction to Modern Econometrics Using Stata | > http://www.stata-press.com/books/imeus.html > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > - -- Carolina Lennon Mobile in Austria: (43) 06 76 59 24 553 Office at Wiiw in Vienna: (43) 01 533 66 10 86 Institute website: http://www.wiiw.ac.at Personal website: http://carolina.lennon.research.googlepages.com/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --00504502cffe279ad30480bbda82-- ------------------------------ Date: Mon, 1 Mar 2010 12:57:30 +0100 From: "Martinez San Roman, Valeriano" <valeriano.martinez@unican.es> Subject: st: estimating production function Dear Stata users, I hope you can help me. I am trying to estimate a cobb-douglas production function (Y=X1^a*X2^b*X3^c*....) using panel data with fixed effects. I am using the log of the production function as my functional form, that is, Ln(Y) = aLn(X1) + bLn(X2) + cLn(X3)+.... And I have to assume that we have constant returns to scale, in other words, the sum of the exponentials must be equal to 1 (a+b+c+...=1) Is there a command to restrict the sum of exponentials to be equal to 1. How can I do it? Thank you very much, Valeriano * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:13:24 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: AW: Tests of overidentifying restrictions after xtivreg2 <> Search the archive, and you get, for instance, http://www.stata.com/statalist/archive/2007-07/msg00979.html HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Lim Boon Leong Gesendet: Montag, 1. Mï¿½rz 2010 13:48 An: statalist@hsphsun2.harvard.edu Betreff: st: Tests of overidentifying restrictions after xtivreg2 Dear Statalisters, I have estimated the following equation by using xtivreg2, gmm function: xtivreg2 lsalary ceodual ........ (ownexr ownex2r ownex3r L.ldiv L.debt=lrisk ..., fe gmm cluster(id) small ffirst The test results turn out fine. But when I continue with the xtoverid test after the above estimation, xtoverid, cluster(id) the following error message appears: xtoverid error: internal reestimation of eqn differs from original r(198); I read the help file of xtoverid and it is mentioned that it supports xtivreg2. May I know what is the problem and how to fix it? Thank you very much in advance. Best regards, Lim Boon Leong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Sun, 28 Feb 2010 11:55:44 -0500 From: "David A. Cort" <dcort@soc.umass.edu> Subject: st: Competing Risk for repeated event nominal dependent variables Dear Listserv, I am attempting to fit discrete-time event history model where the outcome is nominal and can be repeated over time. The social process is residential mobility. Instead of wanting to know the risk of moving into a community or neighborhood (Allison-type model), I'm interested in the risk of moving into a specific type of neighborhood. The dependent variable therefore has multiple categories (4 to be specific) for neighborhood type and time is discretized (into months). Any help concerning how STATA 10 can handle this type of setup would be very helpful. David - -- David A. Cort Assistant Professor Dept. of Sociology University of Massachusetts, Amherst 702 Thompson Hall 200 Hicks Way Amherst, MA 01003-9277 Phone: 413-545-1041 E-mail: dcort@soc.umass.edu Web: www.people.umass.edu/dcort * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:23:25 +0100 From: luc paugam <lukepaugam@gmail.com> Subject: st: testing a model - --00032555af2e6924370480bd2733 Content-Type: text/plain; charset=ISO-8859-1 Hello everyone, I am a new user of stata, and I struggle with this particular issue: I hope I will be clear enough. I would like to test the accuracy of my model in the following manner: Estimate my regression with (*N-1*) observations, and with the coefficients obtained, predict the "*y_hat_i*" of the observation "*i*" I didn't use to estimate the coefficients. I would like to do that *N* times, in order to have *N* "*y_hat_i*" (*i=1, ... ,N*). Than I could compare the "*y_hat_i*" with the real "*y*", and test the accuracy of my model (mean errors, median error, standard deviation etc.) I appreciate your time, Luke * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --00032555af2e6924370480bd2733-- ------------------------------ Date: Mon, 1 Mar 2010 14:26:34 +0100 From: "Sascha Steffen" <steffen@bank.bwl.uni-mannheim.de> Subject: st: Sign of Lambda in heckman This is a multi-part message in MIME format. - ------=_NextPart_000_0001_01CAB94B.31B4AAD0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Dear All, I was wondering about an economic interpretation of the sign of the lambda in a heckman selection model. For example, I am interested in factors reducing default rates of firms. I only observe the performance of the loan once the loan is approved. I use a selection model to account for this. My lambda from the heckman model turns out to be significant and negative. What is the interpretation? In what direction is the bias? Can I interpret the negative sign, that information has been used to screen and filter out bad applicants? What do you think? Best wishes, Sascha * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - ------=_NextPart_000_0001_01CAB94B.31B4AAD0-- ------------------------------ Date: Mon, 1 Mar 2010 14:43:30 +0100 From: Johan Hellstrom <johan.hellstrom@pol.umu.se> Subject: Re: st: Scandinavian letters in Stata Hi Roland, I newer had any problems with the Scandinavian letters in Stata. You might want to consider using an alternative way of importing the data into Stata, e.g. using StatTransfer? Best, Johan * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:44:30 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: AW: testing a model <> Getting the coefficients is easy enough via a judicious choice for the vce: ************* sysuse auto, clear regress price mpg, vce(jackknife, saving(myfile, replace)) u myfile, clear l ************* HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von luc paugam Gesendet: Montag, 1. Mï¿½rz 2010 14:23 An: statalist@hsphsun2.harvard.edu Betreff: st: testing a model Hello everyone, I am a new user of stata, and I struggle with this particular issue: I hope I will be clear enough. I would like to test the accuracy of my model in the following manner: Estimate my regression with (*N-1*) observations, and with the coefficients obtained, predict the "*y_hat_i*" of the observation "*i*" I didn't use to estimate the coefficients. I would like to do that *N* times, in order to have *N* "*y_hat_i*" (*i=1, ... ,N*). Than I could compare the "*y_hat_i*" with the real "*y*", and test the accuracy of my model (mean errors, median error, standard deviation etc.) I appreciate your time, Luke * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:53:27 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: AW: Sign of Lambda in heckman <> As [R], p. 651 says: lambda is the product of rho and sigma. If all you are interested in is the sign, then sigma is irrelevant, since it will always be positive, being a standard deviation. So you are really asking for information about rho: I would check the references at the beginning of the "Methods and formulas" for more insights about its meaning. HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Sascha Steffen Gesendet: Montag, 1. Mï¿½rz 2010 14:27 An: statalist@hsphsun2.harvard.edu Betreff: st: Sign of Lambda in heckman Dear All, I was wondering about an economic interpretation of the sign of the lambda in a heckman selection model. For example, I am interested in factors reducing default rates of firms. I only observe the performance of the loan once the loan is approved. I use a selection model to account for this. My lambda from the heckman model turns out to be significant and negative. What is the interpretation? In what direction is the bias? Can I interpret the negative sign, that information has been used to screen and filter out bad applicants? What do you think? Best wishes, Sascha * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:20:06 +0000 From: Ronan Conroy <rconroy@rcsi.ie> Subject: st: Ana Timberlake obituary There is a moving tributary to Ana Timberlake, founder of Timberlake Consultants, the UK distributors of Stata, in the Guardian. It is a measure of the esteem and affection in which she was held by so many people that her obituary appeared in a national newspaper. One of her own pieces of research was the re-analysis of the results of Robert Borkenstein's 1964 Grand Rapids study, upon which the British breathalyser test had been based in the mid-1960s. The original data had not been statistically adjusted and earlier analysis had suggested that driving improved with the intake of a small amount of alcohol. However, after Ana had standardised the data (for weather, vehicle age, driving experience, and so on), it became clear (much to the chagrin of the brewers) that alcohol intake did indeed make driving capability progressively worse. [description from the Guardian piece} Those of us who met her will remember her fondly, and I am sure that our thoughts are with her family at this time. http://www.guardian.co.uk/theguardian/2010/feb/28/ana-timberlake-obituary Ronan Conroy ================================= rconroy@rcsi.ie Royal College of Surgeons in Ireland Epidemiology Department, Beaux Lane House, Dublin 2, Ireland +353 (0)1 402 2431 +353 (0)87 799 97 95 +353 (0)1 402 2764 (Fax - remember them?) http://rcsi.academia.edu/RonanConroy P Before printing, think about the environment * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 01 Mar 2010 09:29:15 -0500 From: Richard Goldstein <richgold@ix.netcom.com> Subject: Re: st: testing a model have you looked at the -jackknife- command? Rich luc paugam wrote: > Hello everyone, > > I am a new user of stata, and I struggle with this particular issue: > > I hope I will be clear enough. > I would like to test the accuracy of my model in the following manner: > > Estimate my regression with (*N-1*) observations, and with the coefficients > obtained, predict the "*y_hat_i*" of the observation "*i*" I didn't use to > estimate the coefficients. > I would like to do that *N* times, in order to have *N* "*y_hat_i*" (*i=1, > ... ,N*). > > Than I could compare the "*y_hat_i*" with the real "*y*", and test the > accuracy of my model (mean errors, median error, standard deviation etc.) > > I appreciate your time, > > Luke * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 08:27:13 -0600 (CST) From: "Brian P. Poi" <bpoi@stata.com> Subject: Re: st: Repeated time values within panel in levpet STATA output On Sun, 28 Feb 2010, Worku Gebeyehu wrote: > Dear Sir/Madam, > I am a PhD student doing my research on TFP of a panel of firms for the > period 1996 to 2007 and the total number of observations are 8395. I > have been trying to excute the following levpet command. levpet lny , > free(lnl2 lnirm lnlrm) proxy (lnpower) capital (lnk) revenue justid grid > i (eid) t (yr) reps (50) > > However, I have been facing a problem of 'repeated time values within > panel'. I have not faced a similar problem while estimating the same > using FE, RE, OP, etc. I also tried to check the existence of > dublications of years or firm idenity numbers using the stata 'dublicate > report' command, I got a report of 'surplus=0'. Using set tr on, I found > the following report. Because I am unable to understand what it means > due to lack of knowldge in programming, I sent you with all the junk. I > am sorry for that. I am stuck and strongly need your support. > If Worku would send the dataset directly to me (bpoi@stata.com), I'd be happy to look into the cause of this problem. -- Brian Poi (coauthor of -levpet-) -- bpoi@stata.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 15:50:37 +0100 From: Johan Hellstrom <johan.hellstrom@pol.umu.se> Subject: Re: st: lags with multiply imputed panel data If the L. prefix does not work, you can see if creating your lagged treatment variable manually will help: bysort idnum (wave): gen lag_ratecata1=ratecata1[_n-1] Best, Johan * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:57:06 -0000 From: "Nick Cox" <n.j.cox@durham.ac.uk> Subject: RE: st: lags with multiply imputed panel data If L. "does not work", whatever that means precisely, then what this yields is a beast of unpredictable shape. Better to set the time variable to something appropriate, and let any missings in those terms be explicit. Nick n.j.cox@durham.ac.uk Johan Hellstrom If the L. prefix does not work, you can see if creating your lagged treatment variable manually will help: bysort idnum (wave): gen lag_ratecata1=ratecata1[_n-1] * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 07:03:23 -0800 (PST) From: Rosie Chen <jiarongchen2002@yahoo.com> Subject: st: Missing data on outcome and sample selection bias Carlo, thanks for your response. My question is not related to right censoring or independent variables' missing cases. It is the fact that respondents did not answer the question for the outcome variable. We can't impute outcome values, so that's why we often have to delete cases that have missing values on the dependent variable. But there is a potential sample selection bias. So dear all, here are my several questions regarding a multilevel analysis with missing values on the outcome variable: 1) Do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? (2) To what extent do t-tests can be useful for determining sample selection bias? What criterion do we use? Do the significant t tests on all predictors indicate such a problem or half of the tests being significant indicates the problem? (3) If t-test is not a very good tool to assess the problem, should we use Heckman method? Can we use Heckman test to detect and remedy the possible sample selection bias problem with a dependent variable in Stata? I learned that there is a Heckman and a GLLMM syntax in Stata, but I am not sure if it can incorporate all three features (multilevel data structure, multiple-imputed data, and complex survey design) into consideration. Your advice would be appreciated very much, Rosie - ----- Original Message ---- From: Carlo Lazzaro <carlo.lazzaro@tin.it> To: statalist@hsphsun2.harvard.edu Cc: Rosie Chen <jiarongchen2002@yahoo.com> Sent: Mon, March 1, 2010 1:58:39 AM Subject: R: Missing data analysis Dear Rosie, I am not clear about what you mean with "we have to to delete cases that have missing values", since this is not the standard practice. If you mean (right)censored observations, they can be addressed in Stata via Survival Analysis suite (please, see -stset- and related stuff in Stata 9.2/SE). For more details on dealing with missing observations, especially when they're variables rather than outcomes, you might want to take a look at: Little RJA, Rubin DB. Statistical analysis with missing data. Second Edition. Hoboken, NJ: Wiley, 2002. HTH and Kind Regards, Carlo - -----Messaggio originale----- Da: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Rosie Chen Inviato: domenica 28 febbraio 2010 21.31 A: statalist@hsphsun2.harvard.edu Oggetto: st: Missing data analysis Hi, dear listserv members, I have a question that is not specifically related to Stata, but would like to have a try in here: In most studies, we have to delete cases that have missing values on the outcome variable. The issue is whether the deleted cases are significantly different from the final sample we use, because of the potential sample selection bias problem. My question is: do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? Any suggestions are appreciated very much, Rosie * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 16:25:09 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: AW: AW: testing a model <> And here is how you would obtain "yhats" and errors. Note I am giving technical details, not, in any way, shape or form endorsing your approach: ************* sysuse auto, clear tempfile myfile regress price mpg, vce(jackknife, /* */ saving(`myfile', replace)) merge 1:1 _n using `myfile', /* */ norep nogen gen yhat=_b[_cons]+_b[mpg]*mpg gen error=price-yhat ************* HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Martin Weiss Gesendet: Montag, 1. Mï¿½rz 2010 14:45 An: statalist@hsphsun2.harvard.edu Betreff: st: AW: testing a model <> Getting the coefficients is easy enough via a judicious choice for the vce: ************* sysuse auto, clear regress price mpg, vce(jackknife, saving(myfile, replace)) u myfile, clear l ************* HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von luc paugam Gesendet: Montag, 1. Mï¿½rz 2010 14:23 An: statalist@hsphsun2.harvard.edu Betreff: st: testing a model Hello everyone, I am a new user of stata, and I struggle with this particular issue: I hope I will be clear enough. I would like to test the accuracy of my model in the following manner: Estimate my regression with (*N-1*) observations, and with the coefficients obtained, predict the "*y_hat_i*" of the observation "*i*" I didn't use to estimate the coefficients. I would like to do that *N* times, in order to have *N* "*y_hat_i*" (*i=1, ... ,N*). Than I could compare the "*y_hat_i*" with the real "*y*", and test the accuracy of my model (mean errors, median error, standard deviation etc.) I appreciate your time, Luke * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 07:48:03 -0800 (PST) From: Lloyd Dumont <lloyddumont@yahoo.com> Subject: st: Endogenous Regressors Predicted by the Same IV Hello, Statalist. Iâ??m pretty sure that what weâ??re trying to do is mathematically estimable under certain assumptions. So, we are trying to figure out the syntax for the estimating procedure. And, then weâ??d like to clarify the assumptions that have to hold for us to accept the estimates. We are ultimately trying to estimate a dep var we will call Y_dep. Y_dep is being predicted by X_1, X_2, â?¦X_10. But, X_1, X_2, and X_3 are all endogenous. We believe they can all be predicted by the same instrumental variable, Z_1. And, furthermore, we are willing to accept that Z_1 has no direct effect on Y_dep beyond its effects through X_1, X_2, and X_3. Just to make this all a tad more complicated, Y_dep is actually binary, and, this is all being done with survey data. A simple approach usingâ?¦ svy linearized : ivprobit â?¦ seems to preclude our removing certain regressors from the first stage, which we think MAY be part of the required solution to the problem. If we are wrong about that, then there may be a way to use ivprobit? But, we're open to ANY suggestions. Thank you for your help. Lloyd. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 10:56:25 -0500 From: Kit Baum <baum@bc.edu> Subject: re: st: Tests of overidentifying restrictions after xtivreg2 <> I have estimated the following equation by using xtivreg2, gmm function: xtivreg2 lsalary ceodual ........ (ownexr ownex2r ownex3r L.ldiv L.debt=lrisk ..., fe gmm cluster(id) small ffirst The test results turn out fine. But when I continue with the xtoverid test after the above estimation, xtoverid, cluster(id) the following error message appears: xtoverid error: internal reestimation of eqn differs from original r(198); I read the help file of xtoverid and it is mentioned that it supports xtivreg2. May I know what is the problem and how to fix it? This appears to be a bug in xtoverid, and the authors of that routine have been notified. However there is no reason to use xtoverid (from SSC) in this case. The xtivreg2 output, with GMM option invoked, gives you a Hansen J statistic. If xtoverid worked properly, it would give you the same J statistic. The only need for xtoverid is if you had used official xtivreg rather than user-written xtivreg2. Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 10:58:52 -0500 From: Kit Baum <baum@bc.edu> Subject: re: st: re: Solving the moving average in the error structure in a <> Carolina said But now, I would like to correct the bias in the "estimates" (the coefficients) generated by the MA error structure. I was wondering If I can use xtslg. Though, xtslg has not the option bw(5) and I am not sure how to set up the within panel correlations. In particular, I am not very sure how to set up the corr(corr) and rhotype(calc) options. If you can advise me in this respect I would really appreciate it! There is no reason for a MA error structure to induce bias in the OLS coefficients. Departures from IID errors do not generally cause bias or inconsistency in the point estimates. They mess up the VCE. The use of GLS techniques is motivated by the desire to get unbiased point and interval estimates. I'm not sure what 'xtslg' is. Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 11:01:31 -0500 From: Kit Baum <baum@bc.edu> Subject: re: st: Endogenous Regressors Predicted by the Same IV <> Iâ??m pretty sure that what weâ??re trying to do is mathematically estimable under certain assumptions. So, we are trying to figure out the syntax for the estimating procedure. And, then weâ??d like to clarify the assumptions that have to hold for us to accept the estimates. We are ultimately trying to estimate a dep var we will call Y_dep. Y_dep is being predicted by X_1, X_2, â?¦X_10. But, X_1, X_2, and X_3 are all endogenous. We believe they can all be predicted by the same instrumental variable, Z_1. And, furthermore, we are willing to accept that Z_1 has no direct effect on Y_dep beyond its effects through X_1, X_2, and X_3. No can do. This is a textbook case of under(un)identification. You need at least three Z variables to identify the equation, whether or not the estimation technique is OLS, probit, etc. Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 08:12:09 -0800 From: "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu> Subject: st: RE: Missing data on outcome and sample selection bias I don't understand why you can't impute outcome variables. ICE will do it. A recent paper by van Hippel notes that a reasonable approach is to impute all the missing values but then delete the cases with missing y-values. His simulations were for normal variables, but I wouldn't be surprised to see they held for categorical ones. Deleting cases without y values is often very dangerous. I'd use ICE and try it both ways. Note that ICE will impute categorical values. Tony Peter A. Lachenbruch Department of Public Health Oregon State University Corvallis, OR 97330 Phone: 541-737-3832 FAX: 541-737-4001 - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Rosie Chen Sent: Monday, March 01, 2010 7:03 AM To: statalist@hsphsun2.harvard.edu Subject: st: Missing data on outcome and sample selection bias Carlo, thanks for your response. My question is not related to right censoring or independent variables' missing cases. It is the fact that respondents did not answer the question for the outcome variable. We can't impute outcome values, so that's why we often have to delete cases that have missing values on the dependent variable. But there is a potential sample selection bias. So dear all, here are my several questions regarding a multilevel analysis with missing values on the outcome variable: 1) Do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? (2) To what extent do t-tests can be useful for determining sample selection bias? What criterion do we use? Do the significant t tests on all predictors indicate such a problem or half of the tests being significant indicates the problem? (3) If t-test is not a very good tool to assess the problem, should we use Heckman method? Can we use Heckman test to detect and remedy the possible sample selection bias problem with a dependent variable in Stata? I learned that there is a Heckman and a GLLMM syntax in Stata, but I am not sure if it can incorporate all three features (multilevel data structure, multiple-imputed data, and complex survey design) into consideration. Your advice would be appreciated very much, Rosie - ----- Original Message ---- From: Carlo Lazzaro <carlo.lazzaro@tin.it> To: statalist@hsphsun2.harvard.edu Cc: Rosie Chen <jiarongchen2002@yahoo.com> Sent: Mon, March 1, 2010 1:58:39 AM Subject: R: Missing data analysis Dear Rosie, I am not clear about what you mean with "we have to to delete cases that have missing values", since this is not the standard practice. If you mean (right)censored observations, they can be addressed in Stata via Survival Analysis suite (please, see -stset- and related stuff in Stata 9.2/SE). For more details on dealing with missing observations, especially when they're variables rather than outcomes, you might want to take a look at: Little RJA, Rubin DB. Statistical analysis with missing data. Second Edition. Hoboken, NJ: Wiley, 2002. HTH and Kind Regards, Carlo - -----Messaggio originale----- Da: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Rosie Chen Inviato: domenica 28 febbraio 2010 21.31 A: statalist@hsphsun2.harvard.edu Oggetto: st: Missing data analysis Hi, dear listserv members, I have a question that is not specifically related to Stata, but would like to have a try in here: In most studies, we have to delete cases that have missing values on the outcome variable. The issue is whether the deleted cases are significantly different from the final sample we use, because of the potential sample selection bias problem. My question is: do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? Any suggestions are appreciated very much, Rosie * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 08:32:22 -0800 (PST) From: Rosie Chen <jiarongchen2002@yahoo.com> Subject: Re: st: RE: Missing data on outcome and sample selection bias Thanks, Tony. Let me see if I understand you correctly. Did you mean that, by keeping cases that have missing values on the y variable in the imputation process, we should be able to reduce or remove the possible sample selection bias issue because the imputed x variables' values are based on those cases also? I haven't seen anywhere that this is a standard way to do to address the possible sample selection issue, but please correct me if I am wrong. To keep this discussion thread going, I am posting my questions again. Thanks for every input and advice! -- Rosie Dear all, here are my several questions regarding a multilevel analysis with missing values on the outcome variable: 1) Do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? (2) To what extent do t-tests can be useful for determining sample selection bias? What criterion do we use? Do the significant t tests on all predictors indicate such a problem or half of the tests being significant indicates the problem? (3) If t-test is not a very good tool to assess the problem, should we use Heckman method? Can we use Heckman test to detect and remedy the possible sample selection bias problem with a dependent variable in Stata? I learned that there is a Heckman and a GLLMM syntax in Stata, but I am not sure if it can incorporate all three features (multilevel data structure, multiple-imputed data, and complex survey design) into consideration. - ----- Original Message ---- From: "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu> To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> Sent: Mon, March 1, 2010 11:12:09 AM Subject: st: RE: Missing data on outcome and sample selection bias I don't understand why you can't impute outcome variables. ICE will do it. A recent paper by van Hippel notes that a reasonable approach is to impute all the missing values but then delete the cases with missing y-values. His simulations were for normal variables, but I wouldn't be surprised to see they held for categorical ones. Deleting cases without y values is often very dangerous. I'd use ICE and try it both ways. Note that ICE will impute categorical values. Tony Peter A. Lachenbruch Department of Public Health Oregon State University Corvallis, OR 97330 Phone: 541-737-3832 FAX: 541-737-4001 - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Rosie Chen Sent: Monday, March 01, 2010 7:03 AM To: statalist@hsphsun2.harvard.edu Subject: st: Missing data on outcome and sample selection bias Carlo, thanks for your response. My question is not related to right censoring or independent variables' missing cases. It is the fact that respondents did not answer the question for the outcome variable. We can't impute outcome values, so that's why we often have to delete cases that have missing values on the dependent variable. But there is a potential sample selection bias. So dear all, here are my several questions regarding a multilevel analysis with missing values on the outcome variable: 1) Do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? (2) To what extent do t-tests can be useful for determining sample selection bias? What criterion do we use? Do the significant t tests on all predictors indicate such a problem or half of the tests being significant indicates the problem? (3) If t-test is not a very good tool to assess the problem, should we use Heckman method? Can we use Heckman test to detect and remedy the possible sample selection bias problem with a dependent variable in Stata? I learned that there is a Heckman and a GLLMM syntax in Stata, but I am not sure if it can incorporate all three features (multilevel data structure, multiple-imputed data, and complex survey design) into consideration. Your advice would be appreciated very much, Rosie - ----- Original Message ---- From: Carlo Lazzaro <carlo.lazzaro@tin.it> To: statalist@hsphsun2.harvard.edu Cc: Rosie Chen <jiarongchen2002@yahoo.com> Sent: Mon, March 1, 2010 1:58:39 AM Subject: R: Missing data analysis Dear Rosie, I am not clear about what you mean with "we have to to delete cases that have missing values", since this is not the standard practice. If you mean (right)censored observations, they can be addressed in Stata via Survival Analysis suite (please, see -stset- and related stuff in Stata 9.2/SE). For more details on dealing with missing observations, especially when they're variables rather than outcomes, you might want to take a look at: Little RJA, Rubin DB. Statistical analysis with missing data. Second Edition. Hoboken, NJ: Wiley, 2002. HTH and Kind Regards, Carlo - -----Messaggio originale----- Da: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Rosie Chen Inviato: domenica 28 febbraio 2010 21.31 A: statalist@hsphsun2.harvard.edu Oggetto: st: Missing data analysis Hi, dear listserv members, I have a question that is not specifically related to Stata, but would like to have a try in here: In most studies, we have to delete cases that have missing values on the outcome variable. The issue is whether the deleted cases are significantly different from the final sample we use, because of the potential sample selection bias problem. My question is: do we often compare the deleted cases with the final raw sample without missing data imputation or with the final sample with missing cases imputed? Any suggestions are appreciated very much, Rosie * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 17:46:53 +0100 From: Carolina Lennon <carolina.lennon@gmail.com> Subject: Re: st: re: Solving the moving average in the error structure in a - --001485e9ab560ec0ae0480bfff05 Content-Type: text/plain; charset=ISO-8859-1 Many thanks Kit, Sorry, I made a spelling mistake in the previous email, I should have said xtgls instead of xtslg. Again many thanks for you answer. I know that the following question is a little out of scope (since it does not relate to the stata commands), but just in case it is easy for you to reply...Do you know where I can find a reference justifying "that there is no reason for a MA error structure to induce bias in the OLS coefficients"? It would of great help. Indeed, some referees did not like my overlapping regressions because of the bias cused by the MA errors in the point estimates. (My regressions were of the type: xtreg, fe cluster) Therefore, if I can justify it would be just perfect. Many thanks again Carolina 2010/3/1 Kit Baum <baum@bc.edu> > <> > Carolina said > > But now, I would like to correct the bias in the "estimates" (the > coefficients) generated by the MA error structure. I was wondering If I can > use xtslg. Though, xtslg has not the option bw(5) and I am not sure how to > set up the within panel correlations. In particular, I am not very sure how > to set up the corr(corr) and rhotype(calc) options. If you can advise me > in this respect I would really appreciate it! > > > There is no reason for a MA error structure to induce bias in the OLS > coefficients. Departures from IID errors do not generally cause bias or > inconsistency in the point estimates. They mess up the VCE. The use of GLS > techniques is motivated by the desire to get unbiased point and interval > estimates. > > I'm not sure what 'xtslg' is. > > Kit Baum | Boston College Economics & DIW Berlin | > http://ideas.repec.org/e/pba1.html > An Introduction to Stata Programming | > http://www.stata-press.com/books/isp.html > An Introduction to Modern Econometrics Using Stata | > http://www.stata-press.com/books/imeus.html > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > - -- Carolina Lennon Mobile in Austria: (43) 06 76 59 24 553 Office at Wiiw in Vienna: (43) 01 533 66 10 86 Institute website: http://www.wiiw.ac.at Personal website: http://carolina.lennon.research.googlepages.com/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --001485e9ab560ec0ae0480bfff05-- ------------------------------ Date: Mon, 1 Mar 2010 12:13:15 -0500 From: Christopher F Baum <baum@bc.edu> Subject: re: st: re: Solving the moving average in the error structure in a <> Carolina said I know that the following question is a little out of scope (since it does not relate to the stata commands), but just in case it is easy for you to reply...Do you know where I can find a reference justifying "that there is no reason for a MA error structure to induce bias in the OLS coefficients"? It would of great help. Indeed, some referees did not like my overlapping regressions because of the bias cused by the MA errors in the point estimates. (My regressions were of the type: xtreg, fe cluster) Therefore, if I can justify it would be just perfect. Any decent econometrics textbook discusses the consequences of violating the IID error assumption (usually when discussing generalized least squares, or robust standard errors, etc.) Generally speaking we know that AR(1) errors do not cause bias in point estimates. Nor do AR(2) errors, or AR(3) errors, etc. Now a finite MA process, if invertible, can always be expressed as an infinite-order AR process, so what you have is a OLS model with dummy variables with errors orthogonal to the regressors (by assumption of exogeneity). The fact that they can be expressed as a finite-order MA or an infinite- order AR should not matter. See Hansen and Hodrick's article on why overlapping data induce MA(j) where j is one less than the degree of overlap, and the solution being to use Newey-West with j lags. I don't have the H-H cite handy but have mentioned it not too long ago on this list. I don't think -xtgls- will help, as I believe it only allows for AR(1) errors. Kit * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 17:16:43 -0000 From: "Nick Cox" <n.j.cox@durham.ac.uk> Subject: st: FAQ reminders As long-time members will aver, the list works well almost all of the time, especially if the criterion is getting help that is free, fast and good. But all of us some of the time, and some of us all the time, might helpfully pay a little more attention to well-meant advice in the FAQ, intended in the best interests of all. (The URL for the FAQ appears at the bottom of every Statalist posting.) Below my signature please find various extracts from the FAQ signalling some of the most common lapses. And -- if you've never read it -- please do look through the complete FAQ before making your first posting! Nick n.j.cox@durham.ac.uk Plain text only; no attachments =============================== We ask you not to post formatted messages or attachments. Please make sure that your mailer is set to send ASCII or 'plain text' for outgoing messages, or the equivalent for your mailer. That is, do not send HTML, rich text, VCards, winmail.dat files, or anything other than Plain Text. It is your responsibility to find out how to do this in your mailer or email provider. You will not receive any error messages if you send a message that is trapped by Statalist. (Advice on various commonly used systems can be found at http://email.about.com/cs/netiquettetips/qt/et070103.htm.) [2.2] Start a new thread with a new posting ===================================== Please do not start a new thread by replying to a previous posting. Even if you delete the previous posting's contents and change its title, such practice messes up archiving. [2.2; 3.4] Out-of-office ============= Some people use their mailer to send out-of-office messages to Statalist when they travel. You are asked not to do that, because such messages are of no interest or use to almost all readers. If you do send messages of that kind to Statalist, you will usually be unsubscribed by the moderator. You may naturally resubscribe when you return. Similarly, you are asked not to set up your mailer to send such messages to individual posters who send to Statalist. [2.9] Clear questions =============== Many questions do not get answered because they are too short, too unfocused, or too obscure. If you hope that others will spend time answering your question, be prepared to spend time writing as clearly yet as crisply as you can. [3.2] What did you type? What did Stata do? (exactly) =============================================== Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly! If you can, reproduce the error with one of Stata's provided datasets or a simple concocted dataset that you include in your posting. [3.3] State Stata version you use if <11 ================================== The current version of Stata is 11. Please specify if you are using an earlier version; otherwise, the answer to your question is likely to refer to commands or features unavailable to you. Moreover, as bug fixes and new features are issued frequently by StataCorp, make sure that you update your Stata before posting a query, as your problem may already have been solved. [3.3] Explain where commands come from ================================ Say what command(s) you are using. If they are not part of official Stata, say where they come from: the STB/SJ, SSC, or other archives. [3.3] Precise literature references ============================= Please do not assume that the literature familiar to you is familiar to all members of Statalist. Do not refer to publications with just minimal details (e.g., author and date). Questions of the form "Has anyone implemented the heteroscedasticity under a full moon test of Sue, Grabbit, and Runne (1989)?" admittedly divide the world. Anyone who has not heard of the said test would not be helped by the full reference to answer the question, but they might well appreciate the full reference. [3.4] State platform if relevant ========================== Stata runs on different platforms Similarly, please remember that Stata runs on Windows, Macs, and other Unix platforms. Specify the platform you are using if your question is specific to that platform. [3.4] Edit previous postings ====================== Edit mail so that readers see easily what the issue is and what your contribution is. Please do not repost the whole of a very long message together with your one-sentence tidbit. Your mailer may have a facility to select a block of text and then reply quoting only that text. [3.4] Don't walk away from the thread you started =========================================== Continuing or closing a thread you started is important, especially by answering secondary questions and by reporting what solved your problem. You can then thank those who tried to help. [3.4] Re-posts disapproved ==================== If you get no answer, you might be tempted to repost the question, but please think twice before you do that. The same post reappearing repeatedly strikes many Statalist members as impatient and inconsiderate. You had your chance, but no one wanted to answer the question. The best advice is to rewrite the question so that the key issue is made as clear as possible but also is stated as briefly as possible. [4] Spell 'Stata' correctly ======================= Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write "Stata", not "STATA". Mata is also an invented word, not an acronym. [8.2] * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 17:35:27 +0000 From: "Burak Darbaz" <infinisafricae@hotmail.com> Subject: st: Panel LM Unit Root Test with Heterogenous Structural Breaks Hello, Does anybody have a code for Im, Lee & Tieslau (2005) panel LM unit root test with het. structural breaks? I need it for testing unemployment hysteresis as a part of my empirical project. I was able to find Gauss and RATS codes but no chance for STATA. Otherwise, is there any alternatives (besides clemao_io and zandrews)? Thanks a lot, Regards Burak Darbaz * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 18:23:44 +0100 From: Carolina Lennon <carolina.lennon@gmail.com> Subject: Re: st: re: Solving the moving average in the error structure in a - --000e0ce0d6e8e496e60480c08255 Content-Type: text/plain; charset=ISO-8859-1 Great Kit, I found the reference. Hansen, L.P., Hodrick, R.J.. "Forward Exchange-Rates As Optimal Predictors of Future Spot Rates - An Econometric-Analysis." Journal of Political Economy 88: 829-853, 1980. Many thanks Carol 2010/3/1 Christopher F Baum <baum@bc.edu> > <> > Carolina said > > > I know that the following question is a little out of scope (since it does > not relate to the stata commands), but just in case it is easy for you to > reply...Do you know where I can find a reference justifying "that there is > no reason for a MA error structure to induce bias in the OLS coefficients"? > It would of great help. Indeed, some referees did not like my overlapping > regressions because of the bias cused by the MA errors in the point > estimates. (My regressions were of the type: xtreg, fe cluster) Therefore, > if I can justify it would be just perfect. > > Any decent econometrics textbook discusses the consequences of violating > the IID error assumption (usually when discussing generalized least squares, > or robust standard errors, etc.) Generally speaking we know that AR(1) > errors do not cause bias in point estimates. Nor do AR(2) errors, or AR(3) > errors, etc. Now a finite MA process, if invertible, can always be expressed > as an infinite-order AR process, so what you have is a OLS model with dummy > variables with errors orthogonal to the regressors (by assumption of > exogeneity). The fact that they can be expressed as a finite-order MA or an > infinite-order AR should not matter. See Hansen and Hodrick's article on why > overlapping data induce MA(j) where j is one less than the degree of > overlap, and the solution being to use Newey-West with j lags. I don't have > the H-H cite handy but have mentioned it not too long ago on this list. > I don't think -xtgls- will help, as I believe it only allows for AR(1) > errors. > Kit > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > - -- Carolina Lennon Mobile in Austria: (43) 06 76 59 24 553 Office at Wiiw in Vienna: (43) 01 533 66 10 86 Institute website: http://www.wiiw.ac.at Personal website: http://carolina.lennon.research.googlepages.com/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --000e0ce0d6e8e496e60480c08255-- ------------------------------ Date: Mon, 1 Mar 2010 11:41:11 -0600 From: Dana Chandler <dchandler@gmail.com> Subject: st: Text editor that has automatic table of contents? Hello fellow statalisters - I just recently started using Notepad++ and am very happy with the editor (especially after figuring out how to run do-lines from within the program http://s281191135.onlinehome.us/2008/20080427-stata.html). However, one thing that would be really great to have from a text editor is an automatically generated Table of Contents. For example, I frequently write my do-files in indented sections (e.g., prepare data, clean data, analysis 1, etc.). Some LaTeX editors make use of the section/subsection declarations to create a Table of Contents that you can see and point-click to while editting. Are there any text editors that utilize indentation to show the first level or two of heirarchy so that I could have a sense of the whole do-file? Also - even if you don't know of any text editors, are there any tips that people who write their do-files in sections have to offer for keeping track of the structure of very lengthy do-files? Thanks in advance, Dana * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 17:37:02 +0000 From: =?ISO-8859-1?Q?Maximiliano_M=E9ndez_Parra?= <mm273@sussex.ac.uk> Subject: st: Fwd: Saving results in program/loop - --0016367b689e6ef5f00480c0b28a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Dear all, I am trying to do a Monte Carlo experiment. Inside the program there is a loop that performs a given regression 100 times with different specifications for each of the simulations (5000). At the end, the program pick up the minimum t statistic from each of the 100 set of simulations to form a distribution . The problem I have is that I want to know from which of those 100 regressions the minimum t stat come from. Therefore, I need to save the intermediate results. I've tried with postfile, however, it only saves the last set of 100 regressions and I want to have all of them. I've tried putting the commands inside and outside the loop but I failed. Or at least, if it is not possible to save the intermediate results, I would like to know if there is some way of associating those minimum t stats with a give iteration inside the loop. Can you help me? My program looks like this program seascrit1, rclass version 10.0 drop _all set obs 300 *More commands...* forvalues i=3D1/100{ *More commands...* reg XXX YYY ZZZ SSS.... test l.z3t l.z4t scalar Fa`i'=3Dr(F) test l.z5t l.z6t scalar Fb`i'=3Dr(F) test l.z7t l.z8t scalar Fc`i'=3Dr(F) test l.z9t l.z10t scalar Fd`i'=3Dr(F) test l.z11t l.z12t scalar Fe`i'=3Dr(F) scalar ba`i' =3D (_coef[l.z1t])/_se[l.z1t] scalar bb`i' =3D (_coef[l.z2t])/_se[l.z2t] } *end of loop return scalar b1... return scalar b2... .... scalar drop _all end simulate tbr=3Dr(tbr) b1=3Dr(b1) b2=3Dr(b2) b3=3Dr(b3) b4=3Dr(b4) b5=3Dr(b5= ) b6=3Dr(b6) b7=3Dr(b7), reps(5000) : seascrit1 - --=20 Maximiliano M=E9ndez Parra mm273@sussex.ac.uk - --=20 Maximiliano M=E9ndez Parra maximilianomp@gmail.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --0016367b689e6ef5f00480c0b28a-- ------------------------------ Date: Mon, 1 Mar 2010 17:57:44 -0000 From: "Nick Cox" <n.j.cox@durham.ac.uk> Subject: st: RE: Text editor that has automatic table of contents? This may seem too obvious, but I don't think you need any _special_ features for this (although no disrespect to any editor that does offer this support). 1. Use comments and/or blank lines to flag subdivisions. 2. Invent your own conventions for section headings. 3. If you use 1 or 2, then any decent editor will let you see only lines of a certain form temporarily or let you jump between elements of a certain form using some regular expression or other feature. In preparing a paper, I use !!! as a searchable flag for stuff that I know needs to be filled in later. The trick clearly is to use something that doesn't have a meaning otherwise. !! wouldn't qualify! ### or @@@ are other simple examples (for me). 4. Subdivide the do file so that the details are in separate files with informative names. Then use the master/mistress do file as a guide to structure. 5. Too many levels of nesting are as likely to hinder understanding as help it. 6. Never devise a scheme too complicated to explain to anyone else in a minute. Nick n.j.cox@durham.ac.uk Dana Chandler I just recently started using Notepad++ and am very happy with the editor (especially after figuring out how to run do-lines from within the program http://s281191135.onlinehome.us/2008/20080427-stata.html). However, one thing that would be really great to have from a text editor is an automatically generated Table of Contents. For example, I frequently write my do-files in indented sections (e.g., prepare data, clean data, analysis 1, etc.). Some LaTeX editors make use of the section/subsection declarations to create a Table of Contents that you can see and point-click to while editting. Are there any text editors that utilize indentation to show the first level or two of heirarchy so that I could have a sense of the whole do-file? Also - even if you don't know of any text editors, are there any tips that people who write their do-files in sections have to offer for keeping track of the structure of very lengthy do-files? Thanks in advance, Dana * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 12:59:54 -0500 From: Christopher Baum <baum@bc.edu> Subject: re: st: Fwd: Saving results in program/loop I am trying to do a Monte Carlo experiment. Inside the program there is a loop that performs a given regression 100 times with different specifications for each of the simulations (5000). At the end, the program pick up the minimum t statistic from each of the 100 set of simulations to form a distribution . The problem I have is that I want to know from which of those 100 regressions the minimum t stat come from. Therefore, I need to save the intermediate results. I've tried with postfile, however, it only saves the last set of 100 regressions and I want to have all of them. I've tried putting the commands inside and outside the loop but I failed. Or at least, if it is not possible to save the intermediate results, I would like to know if there is some way of associating those minimum t stats with a give iteration inside the loop. ssc type zandrews.ado for an example of how to do this. Kit Baum | Boston College Economics and DIW Berlin | http://ideas.repec.org/e/pba1.html An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 19:04:15 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: RE: Text editor that has automatic table of contents? <> " However, one thing that would be really great to have from a text editor is an automatically generated Table of Contents." In UltraEdit, you can assign bookmarks and give them names. Below the text, you can open a small window "bookmark viewer" where you see the names and can jump to them by double-clicking. Very neat! Those bookmarks persist, even after the text file has been closed, btw. HTH Martin - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dana Chandler Sent: Montag, 1. Mï¿½rz 2010 18:41 To: statalist@hsphsun2.harvard.edu Subject: st: Text editor that has automatic table of contents? Hello fellow statalisters - I just recently started using Notepad++ and am very happy with the editor (especially after figuring out how to run do-lines from within the program http://s281191135.onlinehome.us/2008/20080427-stata.html). However, one thing that would be really great to have from a text editor is an automatically generated Table of Contents. For example, I frequently write my do-files in indented sections (e.g., prepare data, clean data, analysis 1, etc.). Some LaTeX editors make use of the section/subsection declarations to create a Table of Contents that you can see and point-click to while editting. Are there any text editors that utilize indentation to show the first level or two of heirarchy so that I could have a sense of the whole do-file? Also - even if you don't know of any text editors, are there any tips that people who write their do-files in sections have to offer for keeping track of the structure of very lengthy do-files? Thanks in advance, Dana * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 13:11:09 -0500 From: Austin Nichols <austinnichols@gmail.com> Subject: Re: st: Endogenous Regressors Predicted by the Same IV Lloyd Dumont <lloyddumont@yahoo.com> : Kit points out that your equation is underidentified, but if you are willing to assume that the products of Z_1 with X_4,.. X_10 are uncorrelated with the error, you have 7 additional excluded instruments to use. Run IV first using e.g. -ivreg2- (on SSC) ignoring the binary outcome, as the diagnostics for linear IV are better developed and will give you a sense of dp/dX in any case. The key diagnostics here are weak IV stats and the overid test, since you have a pretty weak argument for your exclusion restrictions and no guarantee of strong correlations. Then you can go to -ivprobit- or - -cmp- (SSC) or the like, if linear IV looks good. On Mon, Mar 1, 2010 at 11:01 AM, Kit Baum <baum@bc.edu> wrote: > No can do. This is a textbook case of under(un)identification. You need at least three Z variables to identify the equation, whether or not the estimation technique is OLS, probit, etc. On Mon, Mar 1, 2010 at 10:48 AM, Lloyd Dumont <lloyddumont@yahoo.com> wrote: > Iï¿½m pretty sure that what weï¿½re trying to do is mathematically estimable under certain assumptions. So, we are trying to figure out the syntax for the estimating procedure. And, then weï¿½d like to clarify the assumptions that have to hold for us to accept the estimates. > > We are ultimately trying to estimate a dep var we will call Y_dep. Y_dep is being predicted by X_1, X_2, ï¿½X_10. But, X_1, X_2, and X_3 are all endogenous. We believe they can all be predicted by the same instrumental variable, Z_1. And, furthermore, we are willing to accept that Z_1 has no direct effect on Y_dep beyond its effects through X_1, X_2, and X_3. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 01 Mar 2010 11:22:04 -0700 From: "Luciana Zilberman" <lzilberman@salud.unm.edu> Subject: st: vector with weighted observations question This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. - --=__Part765CBCDC.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I have the following question: I have a dataset I am weighting using the = [aw=3Dweight] command and I was wondering if there is a way to see each = weighted observation for a given variable in Stata (e.g., a vector of = weighted observations). The "sum variable1 [aw=3Dweight] " gives me the = weighted mean for variable1 but I am also interested in getting a vector = that shows the weighted observations. I would really appreciate any help. =20 Thank you. Luciana * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --=__Part765CBCDC.0__=-- ------------------------------ Date: Mon, 1 Mar 2010 14:33:48 -0500 From: Ashlie Delshad <abelmore@purdue.edu> Subject: st: expected values after xtpcse Hello, I would like to generate specific expected values for my DV given key variables on one of my IVs - holding all other IVs constant. I have done this before in STATA, but I'm having difficulty remembering which commands I need to use. I am running a panel corrected Prais-Winsten model(xtpcse). Any help would be much appreciated. Ashlie Delshad, Ph.D. Student Purdue University Department of Political Science * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 19:34:28 +0000 From: "Burak Darbaz" <infinisafricae@hotmail.com> Subject: st: RE: I need help with Extreme Bound Analysis Here's an easy command for Leamer's Extreme Bound Analysis by Gregorio Impavido. http://ideas.repec.org/c/boc/bocode/s347401.html Burak Darbaz - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Kwame Sent: 01 March 2010 03:41 To: statalist@hsphsun2.harvard.edu Subject: st: I need help with Extreme Bound Analysis Dear Statalist Veterans: I am new to Stata but have a project requiring eba (Extreme Bound Analysis). The equation I am estimating is in the form: Y = a +BiI+BmM+BzZ+u Y is the dependent variable I is the vector of free variables (one variable in the present) M is a vector of four variables of interest Z is a vector of control variables (ten in this case) I want Stata to take tow Z variables in each combination (with the I variable and one M variable) but have been getting syntax errors as I try. Below are two questions I'd like you to help me with based upon what I've explained above: What is the correct command to run the model for each of the variables(M)of interest?Is it possible to run eba for all the four variables of interest with a single command and if so what will it be? I appreciate any help you can offer me with this. Kwame * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 20:16:13 +0000 From: Neil Shephard <nshephard@gmail.com> Subject: Re: st: Text editor that has automatic table of contents? On Mon, Mar 1, 2010 at 5:41 PM, Dana Chandler <dchandler@gmail.com> wrote: > Hello fellow statalisters - > > I just recently started using Notepad++ and am very happy with the > editor (especially after figuring out how to run do-lines from within > the program http://s281191135.onlinehome.us/2008/20080427-stata.html). > > However, one thing that would be really great to have from a text > editor is an automatically generated Table of Contents. For example, I > frequently write my do-files in indented sections (e.g., prepare data, > clean data, analysis 1, etc.). Some LaTeX editors make use of the > section/subsection declarations to create a Table of Contents that you > can see and point-click to while editting. > > Are there any text editors that utilize indentation to show the first > level or two of heirarchy so that I could have a sense of the whole > do-file? I'm not aware of anything that does this, and to be honest I suspect it may well be unique to LaTeX anyway. Editors that show the formatted output of LaTeX are in essence compiling it on the fly to display it (the only one I have experience of is Gummi for Linux, see http://gummi.midnightcoding.org/). Often you have to compile LaTeX source a couple of times to get all the referencing correct too. Do-files are never compiled in this way, they're simply read line-by-line by Stata. > Also - even if you don't know of any text editors, are there > any tips that people who write their do-files in sections have to > offer for keeping track of the structure of very lengthy do-files? Stata NetCourse 101 and the subsequent 151 are good courses and provide good advice on organising you work-flow with Stata. The basic approach though is to avoid writing really long do-files. Simply write a small do-file for each specific task and have a "master" do-file that calls each in turn. You might also find some of the advice in http://www.stata-press.com/books/wdaus.html on managing/organising do-files useful too. Neil - -- "... no scientific worker has a fixed level of significance at which from year to year, and in all circumstances, he rejects hypotheses; he rather gives his mind to each particular case in the light of his evidence and his ideas." - Sir Ronald A. Fisher (1956) Email - nshephard@gmail.com Website - http://slack.ser.man.ac.uk/ Photos - http://www.flickr.com/photos/slackline/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 14:39:38 -0600 From: "Qian, Yiming" <yiming-qian@uiowa.edu> Subject: st: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Dear Statalist, I use "estimates store + suest + test" to compare regression coefficients between two samples.ï¿½ It works fine until I tried to adjust clustering in the regressions. Below are detailed description of the problem. Is there a way to can get around this problem using "suest" or some alternative commands? I ran the same regression for two groups (male vs. female): Y = a1*x1 + a2*x2 + a3*x3 + .... I want to test: 1.ï¿½ï¿½ï¿½ï¿½ï¿½ The joint hypothesis that a1 and a2 are the same b/w the two groups. 2.ï¿½ï¿½ï¿½ï¿½ï¿½ The hypothesis that a1/a2 is the same b/w the two groups. The following stata codes work fine:ï¿½ reg y x1 x2 x3 x4 if female==0 estimates store male reg y x1 x2 x3 x4 if female==1 estimates store male suest male female test ([male_mean]_b[x1] = [female_mean]_b[x1]) ([male_mean]_b[x2] = [female_mean]_b[x2]) testnl [male_mean]_b[x1]/[male_mean]_b[x2] = [female_mean]_b[x1]/[female_mean]_b[x2]) However, if I add cluster() to the two regressions, I got error messages.ï¿½ reg y x1 x2 x3 x4 if female==0, cluster(family) estimates store male reg y x1 x2 x3 x4 if female==1, cluster(family) estimates store male suest male female The error message is: "male was estimated with cluster(family). re-estimate without the cluster() option, and specify the cluster() option with suest. r(322);" Thank you very much! Yiming Qian * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 21:51:17 +0100 From: "Martin Weiss" <martin.weiss1@gmx.de> Subject: st: RE: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering <> "The error message is: "male was estimated with cluster(family). re-estimate without the cluster() option, and specify the cluster() option with suest. r(322);"" Just follow Stata`s advice, I would say: ******* sysuse auto, clear reg price weight length if foreign est store for reg price weight length if !foreign est store dom suest for dom, cluster(rep) test ([for_mean]_b[weight ] = [dom_mean]_b[weight ]) ([for_mean]_b[length ] = [dom_mean]_b[length ]) testnl ([for_mean]_b[weight ] / [dom_mean]_b[weight ]) = ([for_mean]_b[length ] /[dom_mean]_b[length ]) ******* HTH Martin - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Qian, Yiming Sent: Montag, 1. Mï¿½rz 2010 21:40 To: statalist@hsphsun2.harvard.edu Subject: st: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Dear Statalist, I use "estimates store + suest + test" to compare regression coefficients between two samples.ï¿½ It works fine until I tried to adjust clustering in the regressions. Below are detailed description of the problem. Is there a way to can get around this problem using "suest" or some alternative commands? I ran the same regression for two groups (male vs. female): Y = a1*x1 + a2*x2 + a3*x3 + .... I want to test: 1.ï¿½ï¿½ï¿½ï¿½ï¿½ The joint hypothesis that a1 and a2 are the same b/w the two groups. 2.ï¿½ï¿½ï¿½ï¿½ï¿½ The hypothesis that a1/a2 is the same b/w the two groups. The following stata codes work fine:ï¿½ reg y x1 x2 x3 x4 if female==0 estimates store male reg y x1 x2 x3 x4 if female==1 estimates store male suest male female test ([male_mean]_b[x1] = [female_mean]_b[x1]) ([male_mean]_b[x2] = [female_mean]_b[x2]) testnl [male_mean]_b[x1]/[male_mean]_b[x2] = [female_mean]_b[x1]/[female_mean]_b[x2]) However, if I add cluster() to the two regressions, I got error messages.ï¿½ reg y x1 x2 x3 x4 if female==0, cluster(family) estimates store male reg y x1 x2 x3 x4 if female==1, cluster(family) estimates store male suest male female The error message is: "male was estimated with cluster(family). re-estimate without the cluster() option, and specify the cluster() option with suest. r(322);" Thank you very much! Yiming Qian * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 20:53:30 +0000 From: Clive Nicholas <clivelists@googlemail.com> Subject: Re: st: expected values after xtpcse Ashlie Delshad wrote: > I would like to generate specific expected values for my DV given key variables > on one of my IVs - holding all other IVs constant. ï¿½I have done this before in > STATA, but I'm having difficulty remembering which commands I need to use. ï¿½I > am running a panel corrected Prais-Winsten model(xtpcse). Any help would be > much appreciated. - -help adjust-? - -- Clive Nicholas [Please DO NOT mail me personally here, but at <clivenicholas@hotmail.com>. Please respond to contributions I make in a list thread here. Thanks!] "My colleagues in the social sciences talk a great deal about methodology. I prefer to call it style." -- Freeman J. Dyson. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 15:57:08 -0500 From: Daniel Miller <danielpmiller@gmail.com> Subject: Re: st: lags with multiply imputed panel data - --00504502cc540586840480c37e58 Content-Type: text/plain; charset=ISO-8859-1 Hi Johan --- thank you for your response. I had set something similar up to get around the problem before --- but was curious if there was a way to sort the data properly. In any case, thank you for the information. Dan On Mon, Mar 1, 2010 at 9:50 AM, Johan Hellstrom <johan.hellstrom@pol.umu.se>wrote: > If the L. prefix does not work, you can see if creating your lagged > treatment variable manually will help: > > bysort idnum (wave): gen lag_ratecata1=ratecata1[_n-1] > > Best, > Johan > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --00504502cc540586840480c37e58-- ------------------------------ Date: Mon, 1 Mar 2010 16:00:37 -0500 From: Daniel Miller <danielpmiller@gmail.com> Subject: Re: st: lags with multiply imputed panel data - --000e0cd2e1a87d20850480c38a2b Content-Type: text/plain; charset=ISO-8859-1 Hi Nick, thank you for replying. As I noted in the original email, I am not sure the issue is that the time variable is not appropriately set, but rather that the data are not sorted properly. I am able to set lags using L. or L2. just fine in any of the individual imputed datasets. It is only when I try a combining algorithm using micombine or mim: that I get an error message like: e.g. mim: xtreg fwork l.ratecata1, fe - -> _mj==1 - -> xtreg fwork l.ratecata1, fe not sorted r(5); Thanks, Dan On Mon, Mar 1, 2010 at 9:57 AM, Nick Cox <n.j.cox@durham.ac.uk> wrote: > If L. "does not work", whatever that means precisely, then what this > yields is a beast of unpredictable shape. > > Better to set the time variable to something appropriate, and let any > missings in those terms be explicit. > > Nick > n.j.cox@durham.ac.uk > > Johan Hellstrom > > If the L. prefix does not work, you can see if creating your lagged > treatment variable manually will help: > > bysort idnum (wave): gen lag_ratecata1=ratecata1[_n-1] > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ - --000e0cd2e1a87d20850480c38a2b-- ------------------------------ Date: Tue, 2 Mar 2010 11:33:04 +1300 From: Thu Phuong Truong <Phuong.Truong@vuw.ac.nz> Subject: st: RE: AW: bootstrap in factor analysis Dear Martin, Thank so much for your kind help. Yours sincerely, Phuong - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss Sent: Tuesday, 2 March 2010 2:08 a.m. To: statalist@hsphsun2.harvard.edu Subject: st: AW: bootstrap in factor analysis <> Type -ereturn list- after the factor command to see the available returned results: ************* webuse bg2, clear factor bg2cost1-bg2cost6, factors(2) pcf eret li ************* HTH Martin - -----Ursprï¿½ngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Thu Phuong Truong Gesendet: Sonntag, 28. Februar 2010 23:21 An: statalist@hsphsun2.harvard.edu Betreff: st: bootstrap in factor analysis Dear Martin and statalister, Thank so much for getting back to me. I am sorry that I did not make it clear in my previous email. I could do bootstrap for regression. However, I have trouble with factor analysis as I do not know what I should include in the exp_list. For example bootstrap exp_list, reps(1000): factor reform_index analyst_index herfindahl5_index ceochair_index brdsize_index brdindp1a ac_index if firmyeartestqualified==1, pcf What should I include as exp_list in order to test whether the factor loadings are significantly from zero? Thank so much for your help. Yours sincerely, Phuong * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 15:51:11 -0700 From: "Buzz Burhans" <buzzb3@earthlink.net> Subject: st: RE: Text editor that has automatic table of contents? Dana, A test editor called EmEditor has a plug in that automates outlining. EmEditor is one of two text editors I have used and liked, it is Windows based, though I run XP Professional, don't know how well it works with Vista or W-7 http://www.emeditor.com/ You've had a couple of suggestions to use a Master -do- file that calls subordinate -do- files - that is excellent advice that I think I picked up on when I took the Net Course 101 or 151 about 10 or more years ago. The Net courses are great!! Related to using Master files, I have also used a text editor called Crimson Editor that allows you to have a "project" pane open on the side, where I keep a sort of outline of the Master file and the subordinate -do- files it calls. It works similarly to having an editor, but allows the files to be separate rather than sections of a single outlined file. http://www.crimsoneditor.com/ Buzz Buzz Burhans, Ph.D. Dairy-Tech Group So. Albany, VT / Twin Falls ID Phone: 802-755-6842 Cell: 208-320-0829 Fax VT: 802-755-6842 Fax ID: 208-735-1289 Email: buzzb3@earthlink.net - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dana Chandler Sent: Monday, March 01, 2010 10:41 AM To: statalist@hsphsun2.harvard.edu Subject: st: Text editor that has automatic table of contents? * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 23:10:54 -0000 From: Z.Ou@warwick.ac.uk Subject: st: Question on survey data analysis Dear Statalists, I am new to stata so please, please forgive me if my question seems too easy for youï¿½ï¿½I designed a survey about loyalty schemes (e.g. tesco clubcard that sort of programmes) for my economics research project, but not sure how to compute multiple choice questions in the questionnaire. One of my questions was: ï¿½ï¿½Why donï¿½ï¿½t you join any loyalty schemes?ï¿½ï¿½ and my list of answers include: a) poor customer service, b) unachievable rewards, c) unrealistic points, d) too much marketing communications, e) redeeming schemes too complicated, f) choice of rewards available and g) others, i.e. 7 options in total. Respondents were asked to tick all that apply. I want to see which are the most deterring factors of the list that make these students not want to join loyalty schemes. Could someone give me any hints? Do I have to create a new dummy variable for each of the seven alternatives? A similar question asked which, if any, respondents are aware of out of a list of ten different stores/retailers who have loyalty schemes. Again, do I have to treat each option as a independent dummy? Also do I have to declare data type as survey data to carry out any further analysis? Or is it alright for me to do simple regression analysis without letting stata know it's survey data I'm working with? Does it affect my results? Thanks very much for your time!!! Michelle * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Mon, 1 Mar 2010 22:20:52 -0600 From: "Qian, Yiming" <yiming-qian@uiowa.edu> Subject: st: RE: RE: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Martin, Thank you very much for your kind help! It answers my question perfectly! I have a follow-up question: can I use similar tests for median regressions (qreg)? If not suest+test, how to compare coefficients across models for median regressions? I tried the following codes: qreg y x1 x2 x3 x4 if female==0 estimates store male qreg y x1 x2 x3 x4 if female==1 estimates store male suest male female I got the following error message: "unable to generate scores for model male suest requires that predict allow the score option r(322);" Thanks a lot! Yiming - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss Sent: Monday, March 01, 2010 2:51 PM To: statalist@hsphsun2.harvard.edu Subject: st: RE: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering <> "The error message is: "male was estimated with cluster(family). re-estimate without the cluster() option, and specify the cluster() option with suest. r(322);"" Just follow Stata`s advice, I would say: ******* sysuse auto, clear reg price weight length if foreign est store for reg price weight length if !foreign est store dom suest for dom, cluster(rep) test ([for_mean]_b[weight ] = [dom_mean]_b[weight ]) ([for_mean]_b[length ] = [dom_mean]_b[length ]) testnl ([for_mean]_b[weight ] / [dom_mean]_b[weight ]) = ([for_mean]_b[length ] /[dom_mean]_b[length ]) ******* HTH Martin - -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Qian, Yiming Sent: Montag, 1. Mï¿½rz 2010 21:40 To: statalist@hsphsun2.harvard.edu Subject: st: using estimate store + suest+test to compare regression coefficients between two samples, how to adjust for clustering Dear Statalist, I use "estimates store + suest + test" to compare regression coefficients between two samples.ï¿½ It works fine until I tried to adjust clustering in the regressions. Below are detailed description of the problem. Is there a way to can get around this problem using "suest" or some alternative commands? I ran the same regression for two groups (male vs. female): Y = a1*x1 + a2*x2 + a3*x3 + .... I want to test: 1.ï¿½ï¿½ï¿½ï¿½ï¿½ The joint hypothesis that a1 and a2 are the same b/w the two groups. 2.ï¿½ï¿½ï¿½ï¿½ï¿½ The hypothesis that a1/a2 is the same b/w the two groups. The following stata codes work fine:ï¿½ reg y x1 x2 x3 x4 if female==0 estimates store male reg y x1 x2 x3 x4 if female==1 estimates store male suest male female test ([male_mean]_b[x1] = [female_mean]_b[x1]) ([male_mean]_b[x2] = [female_mean]_b[x2]) testnl [male_mean]_b[x1]/[male_mean]_b[x2] = [female_mean]_b[x1]/[female_mean]_b[x2]) However, if I add cluster() to the two regressions, I got error messages.ï¿½ reg y x1 x2 x3 x4 if female==0, cluster(family) estimates store male reg y x1 x2 x3 x4 if female==1, cluster(family) estimates store male suest male female The error message is: "male was estimated with cluster(family). re-estimate without the cluster() option, and specify the cluster() option with suest. r(322);" Thank you very much! Yiming Qian * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ Date: Tue, 02 Mar 2010 08:11:15 +0100 From: Maurizio Pisati <maurizio.pisati@unimib.it> Subject: Re: st: using spmap and option "point" Dear Ana, your only chance is to add a variable that identifies regions to "file2.dta", and then use it in suboption -point()- to select only the stores located in regions B or C. To generate such variable, you might want to use a point-in-polygon algorithm -- an example of which, coded in Mata as function -sp_pips-, can be found in the -spgrid- Stata program (ssc install spgrid). Best wishes, Maurizio Il 01/03/10 09.35, Vitorino, Maria Ana ha scritto: > Dear statalist users, > > Is the following possible? > > I have 2 files: > > *file1 is something like: > > region populationsize id > A ... 1 > B ... 2 > C ... 3 > > (I also have a file with the region coordinates so that I can use spmap) > > *file 2 is something like: > > store_id xcoord ycoord > 100 ... ... > 201 ... ... > 345 ... ... > 411 ... ... > 544 ... ... > > > > I would like to do a map with the stores superimposed on the map but only for the stores that are located in region B or C (note that I don't have that information on file2, otherwise it would be easy to do), excluding store 345 (irrespective of where it is located). > > If I do something like the following, the problem is that all the stores (even the ones that are not located in regions B or C) show up...and I only want the ones located in regions B or C. > > spmap populationsize if region=="B" | region=="C" using file1coord, id(id) point(data("file2.dta") xcoord(xcoord) ycoord(ycoord) fcolor(emerald) select(drop if store_id==345)) > > How can I modify this command line to achieve what I'm looking for? > > Any help is appreciated. > Thanks! > > Ana > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ ------------------------------ End of statalist-digest V4 #3716 ******************************** * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Competing Risk for repeated event nominal dependent variables***From:*Mike Lacy <Michael.Lacy@colostate.edu>

- Prev by Date:
**st: stepwise regression for panel data** - Next by Date:
**st: AW: Reference column without knowing variable name?** - Previous by thread:
**st: stepwise regression for panel data** - Next by thread:
**Re: st: Competing Risk for repeated event nominal dependent variables** - Index(es):