305
questions
1
vote
0
answers
116
views
Difference in Standard Errors and p-Values in Two-Way Fixed Effects Logit Model with Interaction Terms using fixest Package in R
I'm working with a two-way fixed effects (TWFE) logit model in R using the fixest package. My model includes interaction terms between some fixed effects and a categorical variable called group. To ...
1
vote
0
answers
22
views
How to generate a bootstrap standard error, t statistics and p value for a user written dynamic panel quantile regression
rm(list=ls())
library(quantreg)
library(SparseM)
library(stats)
rq.fit.panel <- function(X,y,s,w=c(1),taus=0.30,lambda = 0){
# prototype function for panel data fitting of QR models
# the ...
0
votes
0
answers
32
views
Which Statistical Test to Use with Weighted Mean Proportions?
I want to know if the "weighted mean proportion" of a racial group in the organization (overall) is significantly different from the "weighted mean proportion" of the group within ...
2
votes
1
answer
121
views
(Zero Inflated) Negative Binomial Regression with Conley Standard Errors and Weights
My goal is to run a negative binomial regression with conley standard errors and weights. Further below I separately ask about a zero-inflated negative binomial model.
To my knowledge, a negative ...
0
votes
0
answers
33
views
Clustered errors in panel data in Multinomial logistic regression in python (e.g. statsmodels package) sandwich estimator
I am estimating a MNL regression model for customer choices. I have a panel data set with N = \sum_{i=1}^{I} t_{\text{observations}}. Since one individual makes multiple choices in my dataset. ...
0
votes
1
answer
143
views
Clustered/Robust standard errors in R
I am estimating an OLS regression without fixed effects and an OLS regression with fixed effects in R Studio. I have read, that it is common to use robust standard errors, when estimating a simple OLS ...
0
votes
0
answers
24
views
SPSS PROCESS moderation cluster standard errors syntax
I want to conduct a moderation in SPSS PROCESS macro:
IV: Personality trait (measured on likert scale - not repeated measure but constant)
Moderator: low trust vs high trust
DV: initial price offer in ...
0
votes
1
answer
195
views
HAC standard errors in r using plm package?
I want to estimate a fixed effects model (with both country- and year fixed effects) and ADDITIONALLY apply HAC standard errors. Although I didn't get any error message after running the following ...
0
votes
0
answers
18
views
HAC standard errors in r with panel data? [duplicate]
I want to estimate a fixed effects model (with both country- and year fixed effects) and ADDITIONALLY apply HAC standard errors. Although I didn't get any error message after running the following ...
0
votes
0
answers
9
views
How to access the Coefficient and Std Error in the statsmodels.API OLS summary
I have trained a Linear Regression as follows:
import statsmodels.api as sm
model = sm.OLS(Y_Train,X_Train)
result = model.fit()
result.summary()
The results look like this:
I need to calculate the ...
0
votes
0
answers
12
views
Calculate SE using CI
How I could to calculate Standard Error (SE) using only Hazard Ration plus Confidence Interval? Is it possible? Thanks
I dont see how do it with out total number of sample, but, there app Review ...
0
votes
0
answers
34
views
Can I use the sandwich function vcovCL with lavaan output in R?
I have estimated a mediator path model with only observed (no latent) variables and a dichotomous outcome variable using the lavaan package in R (default estimator for ordered endogenous variables = ...
1
vote
1
answer
87
views
How to reverse engineer a dataset?
My teacher gave me the result of a regression and the exercise is to reverse engineer the data set that lead to that regression. Then we need to do a regression on it and find the exact same results.
...
1
vote
1
answer
355
views
Is using the cluster(clustvar) option the same as using vce(cluster clustvar)?
I would like to understand what the cluster option in Stata is doing, preferably directly from official Stata documentation.
For example:
reg outcome predictor, cluster(clustvar)
The documentation I ...
0
votes
0
answers
256
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
9
views
Error messages with SD by Year and Conference
I posted this previously and thought that solved my problem, but I received an error message that stops the calculation.
Again, I am new to R coding, so still trying to figure out the details.
Any ...
0
votes
1
answer
106
views
Regression Coefficients with Interactions and Clustering
I am running a linear regression model that has interaction terms and double clustering, and am having a hard time with getting the combined regression coefficients and 95% confidence intervals in R. ...
1
vote
0
answers
144
views
Is there a way to calculate standard errors for predictions using the geeglm function from geepack?
I want to visualize the results of my model. I do not want to obtain predictions for new individuals.
When I try to use the argument se.fit = TRUE in the predict function with a GEE fitted with ...
1
vote
1
answer
36
views
Testing how well my test data fits to a sinusoidal template in R
In my dataset, I have split my data into testing and training. I have used the training data to fit a sinusoidal curve.
freq = seq(from=21, to=80, by=0.5)
amp = c(-45.22247,-44.87434,-44.30659, -44....
0
votes
1
answer
55
views
How to add all data to a facet_wrap ggplot standard error plot (where facet wrap is already being used to denote a factor)
I'm trying to plot a multipane figure which displays standard error plots of various biodiversity metrics. I have data from five rivers but I want to display the five rivers independently (currently ...
0
votes
0
answers
32
views
Error Bars Do NOT Match Multiple Linear Regression Model
I am trying to fit a linear mixed model using the lme4 package. Every model I try says that 2a and 1a are not significant.
I am curious as to why the error bars do not match what I am seeing in the ...
0
votes
0
answers
88
views
Stargazer() and starprep() with different robust clustered standard errors [R]
Introduction
I need to replicate this regression table in R:
regression table from study
I successfully replicated each individual regression model (1 - 4c) and can display them individually with the ...
0
votes
1
answer
54
views
Quantify confidence on a difference between two groups [duplicate]
I am looking to quantify certainty/confidence on a difference between two groups (see toy dataset):
# Create dataframe
df<-data.frame(
Age=c(40,40,40,40,41,41,41,41),
Strength=c(50,49,46,46,...
0
votes
0
answers
62
views
Type of Standard Errors using PLM Package
Suppose I ran the following R code:
plm(Y ~ X1 + X2, data = df, effect = "twoways", model = "within", index = c("country", "year"))
That is, I have panel data ...
1
vote
0
answers
56
views
Calculate SE and SD in mixed ANOVA
I have conducted a mixed-design ANOVA with a between-subjects factor (Group: Control Group [0] vs. Intervention Group [1]) and a within-subjects factor (Time: Baseline [0], Follow-up 1 [1], and Follow-...
1
vote
1
answer
93
views
Using purrr::map over lmtest::coeftest with the cluster argument calling a variable with the "~" symbol
I am failing to iterate using map (purr package) over the coeftest function (lmtest package) when I specify the argument “cluster.” This argument uses the “~” symbol to call a variable to estimate ...
0
votes
0
answers
87
views
Clustered standard errors with panel data in survregbayes
I'm currently working with a panel dataset containing information on 7903 cities from 2012 to 2022. My focus is on studying the digitalization of city administrations using survival models. ...
0
votes
0
answers
201
views
Linear regression value errors with Scipy
I have two data arrays, xdata of shape (40,) and ydata of shape (40, 721, 1440) (time, lat, lon). My final goal is to compute the regression slope between these two datasets and obtain the errors from ...
0
votes
2
answers
277
views
Using cluster-robust SEs within a zero-inflated negative binomial model through ggpredict won't return confidence intervals
I've been trying to apply cluster-robust standard errors in my calculation of the marginal effects of two predictor variables (main effects and their interaction) in a ZINB model. The code works ...
0
votes
1
answer
89
views
How to add a linear fit to the ggplot graph, when the axis are logarithmic?
I have this following data frame and I calculate a fit line (p) based on logarithmic values of X and Y.
library(ggplot2)
df <- data.frame (Xvalue=c(0.05, 1, 300, 500, 800),
Yvalue=...
0
votes
1
answer
76
views
Estimation of speed from log/Lat co-ordinates?
I have some vehicle based GNSS data. The data is GNSS time to a precision of 1 second and the corresponding lat and long coordinates in decimal degrees.
The data sampling was inconsistent, ie not ...
0
votes
0
answers
79
views
KeyError while using mt.reg (econtools)
I'm using mt.reg to compute Conley standard errors but get this error: KeyError: 'id'
I'm doing this simple regression
shac_params = {
'x': 'lon',
'y': 'lat',
'kern': 'tria',
'...
0
votes
1
answer
88
views
How to get the exact same standard errors obtained in Stata when reproducing survival analysis in R?
I am reproducing in R some survival analysis results published in a journal. The original results were produced in Stata. Here are the original results:
Here is the code to produce these results in R:...
0
votes
1
answer
85
views
Extending error bars in both directions (non-symmetrical), base R, Dynamite Plot
I have written a code to display a dynamite plot the way I like (I modified a function I found on github)
I have made a mock data set for the example, and have been playing around with the code to try ...
0
votes
1
answer
35
views
R - problem with creating a grouped bar chart with precise limits
I am trying to create a grouped bar chart with 4 bars in total (wish of men with no support, wish of women with no support, wish of men who received support, wish of women who received support), plus ...
0
votes
1
answer
140
views
Can I correct the coefficient standard errors after oversampling my data?
I am trying to fit a fixed effects linear regression to my data and interpret the coefficients. I have an imbalanced dataset (~97% negative cases), which was affecting my ability to fit the model and ...
1
vote
1
answer
92
views
Different standard error estimations from linearmodels and statsmodels package
Here are reproducible codes:
import pandas as pd
# Outer is entity, inner is time
entity = list(map(chr,range(65,91)))
time = list(pd.date_range('1-1-2014',freq='A', periods=4))
index = pd.MultiIndex....
3
votes
1
answer
316
views
sandwich is not providing the same covariance matrix for a poisson regression fit with an offset
Poisson regression can be fit to raw data or can be fit by summarizing data and then using an offset. The model should return the same coefficient estimates (as well as covariance estimates), ...
2
votes
1
answer
449
views
Custom Standard Errors with Statsmodels / Stargazer
I am running a series of OLS regressions in Python, where I am using standard errors that I calculate using a custom function.
I am now exporting my regression results into tables, and plan on using ...
2
votes
1
answer
557
views
PyTorch: Compute Hessian matrix of the model
Say that, for some reason, I want to fit a linear regression using PyTorch, as illustrated below.
How could I compute the Hessian matrix of the model to, ultimately, compute the standard error for my ...
1
vote
1
answer
798
views
Plot standard error in base r scatterplot [duplicate]
I am well aware of how to plot the standard error of a regression using ggplot. As an example with the iris dataset, this can be easily done with this code:
library(tidyverse)
iris %>%
ggplot(...
0
votes
1
answer
441
views
Conley standard errors
Is there a rule of thumb for the selection of the radius (cut-off) regarding spatial correlation? I use Conley standard errors in my models.
I could not find explanations on the internet and my ...
1
vote
0
answers
249
views
Calculating Newey-West Standard Errors for a Distributed Lag Model (in R)
This is my first post, so please suggest any improvements to the title or question itself.
I am regressing two xts objects, and want to re-estimate several distributed lag regression models using ...
1
vote
1
answer
484
views
Rolling Window Regression
I need to compute rolling window regressions in Python where the standard errors are corrected for HAC (Newey-West, 1987). I know that statsmodels has a function for rolling window regressions (...
2
votes
1
answer
2k
views
Clustered standard errors, stars, and summary statistics in modelsummary for multinom models
I want to create a regression table with modelsummary (amazing package!!!) for multinomial logistic models run with nnet::multinom that includes clustered standard errors, as well as corresponding &...
2
votes
1
answer
3k
views
Cluster-Robust Standard Errors for Lmer and Glmer in Stargazer (lme4 package)
I have an experimental data set in which subjects were assigned to a specific treatment.
Each treatment consisted of 5 groups. I want to estimate a model that that includes random effects on subject ...
0
votes
1
answer
416
views
The standard error in Poisson model vs bootstrapped SE
I was trying to compare the SEs from two approaches:
the SE printed in the results section in the GLM poisson model, vs.
the SE of the coefficient I got from bootstrapping (basically I resampled the ...
0
votes
0
answers
414
views
Issue with getting robust SEs using Sandwich, merDeriv and glmer of lme4
I would like to get robust estimate of standard error for glmer of lme4. I used the following code that combines sandwich and merDeriv, which previously worked, but now I get an error:
a = lme4::glmer(...
0
votes
0
answers
72
views
R: Least squares estimation in linear equation systems
I'm going to estimate some parameters of linear equation systems with repeated measures. My equations will look like this:
Variant1:
Variant2:
At least 10 values (repeated measures; technical ...
1
vote
1
answer
768
views
How do i extract the standard error from a gaussian GLM model?
I wish to extract the standard error from my Gaussian GLM and my poisson GLM if anyone knows how i can do this?
code for simulated data and both models are below;
#data simulated before fitting models
...