Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Leonardo Guizzetti
    replied
    Originally posted by John Mullahy View Post
    Perhaps this already is possible (but if so I haven't seen how to do it): Could twoway scatteri be modified to accept numlists for the coordinates?
    One workaround can be to build your immediate coordinate list in a macro and then call -scatteri-, as in the following example.

    Code:
    tw scatteri 4 5 4 6 4 7 5 5 5 6 5 7, name(have)
    
    local coordlist ""
    foreach a of numlist 4 5 {
      foreach b of numlist 5(1)7 {
        local coordlist = "`coordlist' `a' `b'"
      }
    }
    di "`coordlist'"
    
    tw scatteri `coordlist', name(want)

    Leave a comment:


  • John Mullahy
    replied
    Perhaps this already is possible (but if so I haven't seen how to do it): Could twoway scatteri be modified to accept numlists for the coordinates? E.g. instead of
    Code:
    tw scatteri 4 5 4 6 4 7
    one could use something like
    Code:
    tw scatteri 4 (5(1)7)
    and instead of
    Code:
    tw scatteri 4 5 4 6 4 7 5 5 5 6 5 7
    one could use something like
    Code:
    tw scatteri (4 5) (5(1)7)

    Leave a comment:


  • Carlo Lazzaro
    replied
    Maarten:
    I do share your point.
    Maybe the "collinearity list" can work for simple cases only; when things get messier, Stata could return something like "collinearity depends on a combination of variables. List unfeasible".

    Leave a comment:


  • Maarten Buis
    replied
    Carlo Lazzaro I don't think so because sometimes a given variable is collinear with acombination of variables rather than a single other variable.

    The classic example would be year of interview, year of birth, and age. If we have interviews that were taken at different years (so year of interview is not a constant), then we might think that the current (at time of interview) situation may influence the outcome, the age of the respondent could influence the outcome, and the circumstances in which the respondent grew up (the year of birth) might influence the outcome. However, age = year of interview - year of birth, so if you know two, you also know the third. So it is the combination of variables that results in perfect colliniearity.

    Leave a comment:


  • Carlo Lazzaro
    replied
    Would it be feasible, in the outcome of any regression model, to list the variable(s) a given predictor is collinear with?
    Last edited by Carlo Lazzaro; 02 May 2019, 09:12.

    Leave a comment:


  • Jesse Wursten
    replied
    Would it be possible to raise the limit on "estimates store"? Currently one can only store 300 estimations, a limit quickly reached if you need to verify robustness to many different specification tweaks.

    Leave a comment:


  • George Hoffman
    replied
    there are multiple user-writtne modules to do variations of quantile regression. these have evolved to meet the many limitations of xtqreg, significantly no factor variables or interactions.
    my suggestion/request: enhance xtqreg functionality to include more of the other xt-class commands.
    if this functionality already exists i apologize and would appreciate education.
    thank you
    George Hoffman

    Leave a comment:


  • Bruce Weaver
    replied
    You pointed me in the right direction, Richard. Re #227 and #228, -regress- followed by -lincom- gives the right result.

    Code:
    webuse nhanes2f, clear
    * Test H0: mu1-mu2 = 10
    generate wt = weight
    replace wt = weight + 10 if sex==2
    ttest wt, by(sex)
    * Perhaps -regress- followed by -lincom- can give the result I want.
    quietly regress weight i.sex
    lincom 1.sex - 2.sex-10
    display "t = " r(t)
    But I still think most users would find it easier if ttest had an option allowing one to specify the value of mu1-mu2|H0. Also, regress does allow various vce() options to deal with variance heterogeneity, but I don't think those options match exactly what you get with the unequal or welch options for ttest.

    Cheers,
    Bruce

    Leave a comment:


  • Bruce Weaver
    replied
    Originally posted by Richard Williams View Post
    Bruce Weaver is this what you have in mind?

    Code:
    webuse nhanes2f, clear
    mean weight, over(sex)
    test Male = Female
    test Male = Female + 10
    Hi Richard. If I use ttest on the same data, I get a different result. It appears that test after means is using N-1 as the df, not N-2. The difference won't matter much with really large samples, I suppose, but people often have relatively small samples when doing t-tests.

    Code:
    webuse nhanes2f, clear
    ttest weight, by(sex)
    display "t^2 = " r(t)^2
    mean weight, over(sex)
    test Male = Female
    * -test- is using df = N-1, not N-2.
    test Male = Female + 10
    * To get the right result with correct df:
    generate wt = weight
    replace wt = weight + 10 if sex==2
    ttest wt, by(sex)
    display "F = " r(t)^2
    * I would like to be able to do something like this:
    *   ttest weight, by(sex) delta(10)
    * where delta = mu1-mu2|H0

    Leave a comment:


  • Richard Williams
    replied
    Bruce Weaver is this what you have in mind?

    Code:
    webuse nhanes2f, clear
    mean weight, over(sex)
    test Male = Female
    test Male = Female + 10

    Leave a comment:


  • Bruce Weaver
    replied
    Apologies if this has already been suggested.

    For ttest, it would be great if one could specify a nonzero difference between mu1 and mu2 for unpaired t-tests.

    Context. I teach my students that all t-tests have a common format, as follows: t = (statistic - parameter|H0) / SEstatistic. (See attached slides for a nicer view of that.) For an unpaired t-test, the statistic = the difference between the two sample means, the parameter|H0 = the specified difference between the two population means (which does not necessarily have to be zero), and SEstatistic = the standard error of the difference between two independent means. To illustrate a null specifying a nonzero difference between population means, I made up an example stating that in 1960, the population difference in height between men and women was 5 inches. Someone collecting data currently wishes to test the null hypothesis that the difference is still 5 inches. It would be great if statistical software allowed one to test hypotheses like this without having to resort to the trickery of subtracting a given amount (5 inches in this case) from the scores of one group.

    Cheers,
    Bruce


    Click image for larger version

Name:	IntroBiostats_08_slide39.png
Views:	2
Size:	161.8 KB
ID:	1494894 Click image for larger version

Name:	IntroBiostats_08_slide40.png
Views:	1
Size:	88.6 KB
ID:	1494895
    Attached Files

    Leave a comment:


  • Richard Williams
    replied
    If it can legitimately be done, I would like to see fixed effects models supported by xtologit. This paper claims that "The fixed effects ordered logit model is widely used in empirical research in economics." Well, maybe so, but I don't know how they do it. https://www.cemmap.ac.uk/uploads/cem...is%20Muris.pdf

    Using a hybrid model has been suggested. (I think maybe the user-written xthybrid can do it easily) Allison discusses the pros and cons of that approach at https://statisticalhorizons.com/prob...-hybrid-method If Stata can improve on xthybrid or make it easily implemented as an option in commands maybe that would be a good approach, e.g. add a hybrid option.

    I wonder if fixed effects options could be built into me commands. Right now many models can be estimated by either xt or me commands. But, as far as I know, FE models can only be estimated with xt commands.

    Leave a comment:


  • Joseph Coveney
    replied
    Good points. Sounds like a bug, frankly: if Stata can sort a string variable, then there's no reason why collapse can't deliver the "maximum" string value.

    (By the way, missing is not ignored by collapse for string variables as it is for numeric—run the attached do-file to see.)
    Attached Files

    Leave a comment:


  • Clyde Schechter
    replied
    Those are good points for not treating string variables as having ordinal properties at all. But how would they justify supporting (min) but not (max)? True, the empty string (missing value) sorting first defines an asymmetry, but for numeric variables have an asymmetry as well with missing values sorting last. (min) and (max) both ignore missing anyway, so the same convention could be applied to string variables.

    Leave a comment:


  • Joseph Coveney
    replied
    Originally posted by Clyde Schechter View Post
    But what Stata actually does is allow (min) but not (max)--which makes no sense to me.
    Do you think that this has to do with the way missing values are handled in string variables?

    Perhaps with the added wrinkle of Unicode now. With other software (e.g., Microsoft SQL Server), the sort order of string data, especially in an international setting, gets thick fast.

    Leave a comment:

Working...
X