Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard errors different from R #55

Open
pdeffebach opened this issue Dec 13, 2020 · 2 comments
Open

Standard errors different from R #55

pdeffebach opened this issue Dec 13, 2020 · 2 comments

Comments

@pdeffebach
Copy link

The coefficients match those of R's "quantreg" but the standard errors do not. I have a dataset df that I can email you the replication data for

r$> rq(logwk ~ educ, tau = .5, data = df) %>% summary                                                     

Call: rq(formula = logwk ~ educ, tau = 0.5, data = df)

tau: [1] 0.5

Coefficients:
            Value     Std. Error t value   Pr(>|t|) 
(Intercept)   5.64624   0.02656  212.62115   0.00000
educ          0.06384   0.00200   31.90678   0.00000
julia> qreg(@formula(logwk ~ educ), df, .5)
StatsModels.TableRegressionModel{QuantileRegressions.QRegModel,Array{Float64,2}}

logwk ~ 1 + educ

Coefficients:
──────────────────────────────────────────────────────
             Quantile   Estimate    Std.Error  t value
──────────────────────────────────────────────────────
(Intercept)       0.5  5.64592    0.00808325   698.471
educ              0.5  0.0638774  0.000609826  104.747
──────────────────────────────────────────────────────

Would be great to pin down the source of these variations. They can't both be right!

@pdeffebach
Copy link
Author

A friend of mine has access to Stata. The Julia output matches the Stata output

qreg logwk educ, q(.5)

 Raw sum of deviations 14405.89 (about 6.4515071)
  Min sum of deviations 13273.92                    Pseudo R2     =     0.0786

------------------------------------------------------------------------------
       logwk |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        educ |   .0638774   .0006674    95.71   0.000     .0625693    .0651855
       _cons |   5.645916   .0088464   638.22   0.000     5.628577    5.663255
------------------------------------------------------------------------------

@pkofod
Copy link
Owner

pkofod commented Dec 17, 2020

Interesting. I think this might be a question of choice of method. There are different ways to obtain the standard errors, so maybe it's just that? I don't remember the default in Koenker's package, but I'm pretty sure it's possible to pick something close to ours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants