Skip to main content

All Questions

Tagged with
0 votes
1 answer
40 views

Save stargazer table as JPG image

I am running some regression tables with stargazer. Is there any way I could save them directly as JPGs or any other image format. Here is some sample code: library(stargazer) data(mtcars) model1 <...
YouLocalRUser's user avatar
-3 votes
0 answers
51 views

How to perform a beta regression on a dataset manually? [closed]

I'm working on a project that involves performing a beta regression on a dataset, I'm not sure how it works apart from R's built-in betareg function, i.e. how I would perform a beta regression ...
Support Systems's user avatar
0 votes
1 answer
70 views

Differences in R and Stata in logistic regressions [closed]

So I'm replicating a paper, most probably done on Stata judging by the appearance of the graphs. However I'm using R, and while the numbers are exactly the same when it comes to variable construction, ...
Val's user avatar
  • 59
0 votes
0 answers
30 views

rms::pentrace() grid set-up

In the R package rms, the pentrace() function enables penalized maximum likelihood estimation on a regression model that was initially fitted using unpenalized methods. The function needs a grid of ...
user167591's user avatar
0 votes
0 answers
10 views

Post-hoc test in R for lm() with significant interaction between numeric and multiple categorical variables [migrated]

I am interested in how the relationship between two traits (trait1 and trait2) varies between groups (A and B) and treatments (C and T). Specifically, I want to know whether the relationship between ...
Teagan LeVar's user avatar
0 votes
0 answers
38 views

Event Study Design using OLS yields estimates despite no variance in outcome variable

I am running an event study design and get some unexpected behavior using OLS. One of my outcome variables is by definition zero before the treatment, i.e., whenever event time is weakly smaller than ...
Simon's user avatar
  • 25
2 votes
1 answer
120 views

Creating a specific B-spline basis matrix

Suppose I have data x = (x_1,...,x_n). I would like to create a basis matrix in R whose (i,j)th entry is B_j(x_i) - B_j(0), where B_j(.) is the jth cubic B-spline basis function. Is this possible to ...
User505's user avatar
  • 23
0 votes
1 answer
78 views

Comparing nls() to nls2() - what am I doing wrong

I am trying to emulate an nls() fit with nls2() via brute-force, when nls() works, so that I can look to a second option when it doesn't. What am I doing wrong in how I have specified nls2() below? Is ...
LucaS's user avatar
  • 1,315
1 vote
1 answer
41 views

How to extract Std.Dev from VarCorr glmmTMB

I'm using the emmeans package with a negative-binomial model implemented using the glmmTMB package. I'm trying to bias adjust my backtransformed emmeans per the workflow illustrated here: https://cran....
myfatson's user avatar
  • 561
0 votes
1 answer
64 views

How do I read the results of a Hausman Test for a fixed effects and half-fixed effects model in R (using the plm package)? [closed]

I have 3 models for measuring how trading size (amount) affects bond prices. I'm using the plm and fixest packages. I have a random effects model: random_model <- plm(Price ~ Amount + control, data ...
FPiper's user avatar
  • 83
1 vote
0 answers
37 views

Issue with Formative PLS-SEM Model in seminr Package for Economic Development Index

I am working on a formative PLS-SEM model to create an economic development index using the seminr package in R. In my model, I have 4 latent variables (Education, Health, Infrastructure, and ...
Velton Sousa's user avatar
1 vote
1 answer
55 views

How to use for loops to run univariate linear regressions for 2 variables?

I'm an R beginner and keep banging my head over this. Is there any way to get the below problem solved? I have a ts object (called mg.ts) with values for all of my x variables (gdp for 10 countries) ...
Rbeginner12345's user avatar
2 votes
0 answers
38 views

How can I prevent stepAIC in caret::train from removing main effects involved in interaction terms to maintain hierarchical regression principles?

I’m using caret::train in R with method = "glmStepAIC" to perform stepwise regression with repeated cross-validation (trControl = splitRule). My model includes interaction terms and I want ...
Coraline Lowes's user avatar
1 vote
0 answers
34 views

Automatically Display Overall and Subgroup‐Specific Effects for a Predictor in gtsummary

I have a linear model with an interaction between a continuous predictor and a binary grouping variable. For example, consider the model model <- lm(y ~ age + gender + X * Group, data = mydata) ...
c_dinosaur's user avatar
3 votes
1 answer
54 views

Error in predict.train .... type must be either "raw" or "prob"

I am using caret with ranger for regression but I need to set quantreg = TRUE as I need this to compute quantiles (see below) some extract of my code. But I am getting this error: Error in predict....
Grace's user avatar
  • 33

15 30 50 per page
1
2 3 4 5
316