153 questions
2
votes
0
answers
88
views
Quantify sum of squared differences in a robust multilinear regression in R
I would like to obtain estimates of the variance explained by each predictor in multiple regression using robust linear regression (for instance with the R function lmrob from robustbase R package or ...
0
votes
0
answers
146
views
Calculation of robust standard errors with gam model
I would like to run a generalised additive model (GAM) regression with some clustered survey data, where I fit a spline for one of the variables. I would like to estimate robust standard errors, ...
0
votes
1
answer
118
views
Error using mcp2atm function for robust pairwise comparisons - undefined columns selected
I used a robust two-way ANOVA using the WRS2 package (R v.4.4.1), using the following code as suggested by Mair and Wilcox (2020) - the full dataset is on the bottom of this message:
library(WRS2)
...
0
votes
1
answer
36
views
How can I store list of t1waybt ANOVAs (WRS2 package) into a data frame (R)
I have computed 12 ANOVAs using WRS2 package, with the t1waybt function. I would like to be able to put all of these results into a data frame so I can view/print them all.
I have tried the following ...
1
vote
1
answer
2k
views
Difference between rlm() and lm_robust
Due to outliers, I would like to use a robust regression method instead of lm().
I can't decide whether to use lm_robust (estimatr package) or rlm (MASS package).
Are there mathematical differences ...
0
votes
0
answers
518
views
Replacing Standard Errors in a GLM Model in R [Follow-up]
My post is a follow-up question to this one: Replacing Standard Errors in a Reg Model in R
I am in search of a way to directly replace the standard errors in a regression model with my own standard ...
0
votes
0
answers
69
views
How can I compare the results of two lmRob() models?
I am looking for a way to compare the results from two lmRob() functions statistically.
Here is an explanation of what I am trying to do: My professor wants me to compare the results of two ANCOVAs (...
1
vote
2
answers
57
views
apply a function to a robust data frame with similar variables
Perhaps someone could help me to elaborate better on the title of this post.
I am trying to apply the exact same formula to several sites (Australia, Mexico and France). Each site has the same ...
1
vote
0
answers
18
views
How to flag Outlyingness using Stanhel-Donoho Estimator in R
Please, I need help to successfully run the Stanhel and Donoho Estimator on my data to flag outlyingness. I have a four column data with the summary presented below:
Data Summary
I did some study on ...
0
votes
2
answers
436
views
What the purpose of 'bufp += nread;' in the Robust reading rio_read() function?
I'm reading the code below in Chapter 10 in the book called Computer System: A Programmer's Perspective. I understand all the code below except the line: bufp += nread; I found this line is pointless, ...
1
vote
0
answers
23
views
Lmrob returning infinity for t-value of the parameter incorrectly
I have time series with outliers, and I want to get a robust estimate of the trend and its t-value. For that I use lmrob, which works fine in most cases. However, in some cases, it returns -inf for ...
0
votes
2
answers
363
views
Error in round(x[[y]], digits = digits) : non-numeric argument to mathematical function
I was trying to fit a linear regression model using the lm function on a dataset (in R):
model <-lm(DLP~gender+Kvp120+mAs+length+gantry+device_age+detectors+scanner2,data = data)
and here were the ...
1
vote
1
answer
50
views
Variable in a function is not used as the value
I am using the package robust.arima in R, which works fine when I call it in a script. However, I want to organize my files and therefore call robust arima in a function. Here all of a sudden the ...
1
vote
0
answers
199
views
Manually calculate robust standard errors of 2SLS regression
I used the "systemfit" function in R to estimate a 2SLS model as it allows to specify the first and second stage separately which is important for my estimation. I need robust standard ...
1
vote
0
answers
110
views
automatic selection of lag order in robust arima R always returns maximum number of AR lags
I am using library robustarima, which has an option auto.ar=TRUE. According to the description and the book (https://onlinelibrary-wiley-com.eur.idm.oclc.org/doi/pdf/10.1002/9781119214656 chapter 8 ...
1
vote
1
answer
771
views
Extract residuals from heteroskedasticity robust standard model (lm_robust())
I need to extract residuals from a model in R where I have used
lm_robust(XS1 ~ rmrf + smb + hml + umd, data=df)
Does anybody know how to do it, please?
The use of residuals(), resid(), rstandard() ...
0
votes
1
answer
419
views
statsmode ols with two-way clustered SD gives me an error with the groups
I have a data set of bond issuance that looks like the following:
IssuerCUSIP
NATION
Industry
Amount
IssuedPostEvent
YEAR
QUARTER
000001
Mexico
A
100
0
2010
2010Q1
000002
China
B
200
1
2015
2015Q2
...
1
vote
1
answer
391
views
how are the p-values in lmrob() calculated?
I need to do a robust regression with lmrob(). For that I need to know how the p-value in the summary is calculated. I can not find anything in the documentation. Maybe anybody has an idea.
Thanks
0
votes
0
answers
390
views
Compare regression with robust standard errors to null using Wald's Test in R
I am running a regression model that looks like this:
wwMLR <- lm(contAOMIdiff ~ PHQ9 + KVIQtot, data = wwMeanWide4)
Having used check_heteroscedasticity(wwMLR) from the Performance package I can ...
0
votes
1
answer
82
views
ClubSandwich::conf_int in meta-analysis - SE formula does not give the same CIs
So I'm using metafor (rma.mv) and clubSandwich to compute a CHE model meta-analysis, but when I use the clubSandwich::conf_int function to estimate my cluster robust SEs and CIs, I noticed some ...
0
votes
0
answers
306
views
Robust regression does not converge after inclusion of interaction terms
I am performing a linear regression to evaluate the effectiveness of mitigation measures, essentially reproducing the attached regression equation. However, I ran into problems of significant outliers ...
1
vote
0
answers
265
views
Summary from Statsmodels after rlm_model not matching the norm that was used
I am using the below code to perform a TukeyBiweight(Bisquare) Robust linear Model Regression of data X and y.
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error,...
2
votes
1
answer
1k
views
Robust regression p values with lmrob
I am trying to do robust multiple regression for a dataset where a few outliers don't allow me to see the underlying patterns through the usual linear models.
I am using the function lmrob in the ...
0
votes
1
answer
1k
views
How to implement HAC Standard Errors in r
I need to solve the issue of serial correlation in a within-model.
I calculated the regression with country- and year-fixed effects and then calculated robust standard errors HC1. How can I calculate ...
2
votes
2
answers
1k
views
How to extract robust standard errors in r?
I calculated robust standard errors after running a regression with lm() function.
# robust standard errors
cov2I <- vcovHC(ols2I, type = "HC1")
robust_se2I <- sqrt(diag(...
1
vote
0
answers
46
views
get value of a uncertain variable in Julia JuMPeR
I want to solve a robust optimization problem with Julia JuMPeR. Is there any way to get the values of uncertain variables in the solution in Julia JuMPeR? I am using Julia v1.5.
0
votes
0
answers
286
views
Hierarchical linear regression (HLR) - can I perform each model/step using an Robust Linear Model (RLM)?
BACKGROUND:
I'm conducting a hierarchical linear regression using R (specifically R studio, Version 4.1.3). I want to use robust linear models (using the rlm function, MM-estimator) for each of my ...
2
votes
0
answers
237
views
Running a robust mixed model ANOVA using statsmodel anova_lm
I have a data set of users behavior which I want to run series of ANOVA's on, based on there outcome of assumption checks. For situations where the assumption of homogeneity isn't met I would like to ...
1
vote
1
answer
1k
views
how to pool MI confidence intervals of robust mixed model in r?
I can run the rlmer model with the object that results from mice, but when I try to pool the results a get the message Error: No tidy method for objects of class rlmerMod. Is there an alternative?
...
4
votes
1
answer
3k
views
R plm vs fixest package - different results?
I'm trying to understand why R packages "plm" and "fixest" give me different standard errors when I'm estimating a panel model using heteroscedasticity-robust standard errors (&...
1
vote
2
answers
2k
views
get p value and r value from HuberRegressor in Sklearn
I have datasets with some outliers.
From the simple linear regression, using
stat_lin = stats.linregress(X, Y)
I can get coefficient, intercept, r_value, p_value, std_err
But I want to apply robust ...
6
votes
2
answers
551
views
What is a sorting algorithm that is robust to a faulty comparison?
I want to sort a list of n items with a comparison sort. However, one of the comparisons made by the algorithm will be flipped from what it's supposed to be. Specifically, there is one pair of items ...
1
vote
0
answers
220
views
autoplot function with pca.robust in R
I'm trying to plot the robust principal components with prcomp.robust but don't work; however, if I just use the prcomp function it works.
The error message is below:
robust2 <- prcomp.robust(iris[,...
0
votes
0
answers
228
views
RLM Residual in Python Statsmodel
I am trying to generate response type residual (y^-y)for RLM using statsmodel:
model=smf.rllm('y~x', data=x)
results=model.fit()
resid=results.resid
I have generated residual using the above code. ...
3
votes
0
answers
516
views
Huber-M estimator for Robust Linear Regression R Vs Python
For Robust Linear regression in R using package Huber-M estimator, we use the below code:
rlm(x,y, weight,init='ls' psi=psi.huber, scaler.est=c('MAD'), method=c('M), maxit=50)
Is there any similar ...
3
votes
2
answers
2k
views
Weighted GLM: R Vs Python
In R, we below code for weighted GLM:
glm(formula, weight)
R Documentation: an optional vector of ‘prior weights’ to be used in the fitting process. Should be NULL or a numeric vector
In Python, ...
0
votes
1
answer
1k
views
How to properly use RobustScaler for improving LinearRegression model?
As to improve my LinearRegression model I was adviced to use Standardization, i.e. RobustScaler for better performance.
My shapes of train and validation sets:
Train set: (4304, 20) (4304,)
Validation ...
3
votes
1
answer
243
views
`glmRob()` does not predict when given `newdata` argument
The following is some slightly modified code from the glmRob() examples. When given the newdata argument, predict.glmRob() errors out. Am I doing something wrong?
suppressMessages(library(robust))
...
0
votes
2
answers
519
views
Problem with post hoc comparison using Robust ANOVA in R
I am trying to conduct a robust ANOVA including post-hoc test using WRS2 package in R. My data structure is as such:
1 dependent variable (res)
2 independent variables: between (group) - within (bla)
...
0
votes
1
answer
408
views
Extract credible intervals for robust correlations in R
I currently know how to use pbcor from the WRS2 package to extract robust correlations. This function calculates the 95% bootstrap confidence intervals around the estimated robust correlation. For ...
0
votes
1
answer
247
views
pbcor and ggcorrmat correlations give different confidence intervals in R
I am working with multiple variables, where I would like to run a robust correlation and then extract the 95% confidence intervals. I am able to do this using pbcor from the WRS2 package.
However, ...
0
votes
1
answer
657
views
Huber Regressor returns inconsistent sign of coefficient
I've been trying to perform a Huber Regressor (sklearn.linear_model) on Time Series.
I came across a strange phenomena: at time it returns a very small negative coeff and sometimes positive although ...
1
vote
0
answers
618
views
Manually calculating robust standard errors for pglm using gradient and hessian matrix
I want to manually calculate robust standard error for a fixed effect poisson model produced using the pglm function that, unlike the plm function, does support sandwich error matrices. This make ...
2
votes
0
answers
504
views
robustlmm function rlmer() too slow
I want to conduct a mixed model with robust standard errors in a dataset with 45,000 rows. When I try to run the below code using rlmer() from the robustlmm package, it doesn't produce any result ...
0
votes
0
answers
140
views
R packages and VCE option
I am a graduate student using R and Stata.
When I was working with both of the programs, I thought that "why do not R packages provide the VCE option?"
What I mean is that although we very ...
1
vote
1
answer
696
views
Why the MAD that is calculated with the function scipy.stats.median_absolute_deviation it's different from the function i did?
Next I present the code made, I create the DMA function which has the formula of the absolute mean deviation, the other two print's compute the DMA of the stats package and robust, as we see both ...
0
votes
1
answer
263
views
Is R Sandwich package not generating the expected clustered robust standard errors?
Load data
utils::data("InstInnovation", package = "sandwich")
df <- InstInnovation
Create group variable combining 'company' and 'year'
df[['cluster_var']] <- factor(paste0(...
3
votes
0
answers
605
views
Robust Standard Errors with plm automatically computed?
Today I ran a fixed effects model in plm using unbalanced panel data with N>>T (N=5970 and T=10). Unfortunately the data is from a database that does not allow me to share it. However, my equation is ...
1
vote
2
answers
1k
views
Stargazer dosen't show number of observations for robust s.e
I'm trying to use stargazer to output some regression results with robust standard errors, but the lines in the bottom for values like nobs and f stat doesn't show. here are the code and the output.
...
1
vote
1
answer
1k
views
Why is lm_robust() HC3 standard error smaller than coeftest() HC0 standard error?
I am using lm_robust of package 'estimatr' for a fixed effect model including HC3 robust standard errors. I had to switch from vcovHC(), because my data sample was just to large to be handled by it.
...