Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
44 views

I can't seem to wrap my head around this: What is the glm() equivalent for lm(log(y) ~ x1 + x2, data=data)? Is it? a. glm(y ~ x1 + x2, data=data, family=gausssian(link="log")) b. glm(log(y) ...
Mubita 's user avatar
1 vote
1 answer
52 views

Problem I have a working PM code, but as soon as I add LM setup, the GDT base gets assigned a garbage address, cr registers don't load properly and I get into a boot loop. I tried hard-coding the ...
Adi Mehmedičević's user avatar
0 votes
0 answers
49 views

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
  • 35
1 vote
1 answer
55 views

This is my first consult, happy to share the community :) (You would notice I'm not a native english speaker and also I'm not very good using R, actually these are my firsts steps). I'm trying to ...
Josep Ramos's user avatar
0 votes
1 answer
51 views

Is there a way in the stepwise procedure to control that a set of variables get added or removed as a group? Particularly, if I form a squared value of variable, that the linear and squared term would ...
JohnS's user avatar
  • 21
0 votes
2 answers
98 views

This question comes up regularly, especially in the context of finance where one wants to calculate rolling exposures to factors, but there seems to be no answer. There are a number of R packages, ...
ivo Welch's user avatar
  • 3,098
0 votes
1 answer
58 views

I have a code that works if I am using LM but not if I am using a GAM. I guess the that for whatever reason LM looks inside object for the variable and GAM just looks at the names of the object but I ...
adrianmnc's user avatar
1 vote
2 answers
123 views

I am performing a linear regression with one continuous predictor and one categorical (two levels) predictor. I have included the categorical factor as a named factor ("Control" and "BD&...
okaywell's user avatar
1 vote
1 answer
105 views

EDIT: I would like help closing my question. This question was originally posted on Cross Validated, should have stayed there because the answer is more of a statistics question and not a programming ...
J. Holiday's user avatar
1 vote
1 answer
69 views

I work with longitudinal (repeated measures) models of clinical trial data. Patients are randomized to different treatment groups and measured over multiple pre-specified points in time. An example ...
landau's user avatar
  • 5,891
1 vote
1 answer
127 views

After running a panel model (5475 units, 13 years) with stats::lm(), I've been trying to estimate heteroskedasticity robust standard errors with estimatr::lm_robust(). It turns out that some ...
user123456's user avatar
4 votes
0 answers
303 views

I have data where I want to compare the level of a factor with the mean of another level of that factor. In addition, I want to create this contrast for all levels of another factor. So I want to get ...
T-Porsch's user avatar
0 votes
2 answers
138 views

I was able to create a tibble with results of 12 linear models as lists with the code below. These are linear models between average monthly flow (MMF) and watershed area (DRAINAGE_AREA_GROSS) and the ...
Jacob Bauer's user avatar
0 votes
0 answers
63 views

I'm doing an analysis on how wind turbine parameters affect wind speed. Dataset from: https://datadryad.org/stash/dataset/doi:10.5061/dryad.vx0k6djxg mod4= lm(wind_speed~turbine_distance* rotor_size *...
user24217668's user avatar
0 votes
1 answer
90 views

I am using the caret package for fitting different models with the same data. I am using cross-validation for all of them; however, when I use different number of folds with the lm method, I get the ...
Juan P FZ's user avatar
  • 363
1 vote
1 answer
283 views

After running a statistical model in R (e.g., glm, lm, lme4::lmer, etc.), I run the summary() command with corr=TRUE to get the Correlation of Coefficients table. It features a matrix of correlations ...
kneergaard's user avatar
1 vote
1 answer
48 views

I have a df with a response variable that changes with time. When plotting the data, there is a plateau of which I want to get rid of, since I need the steepest slope of the regression: time=c("...
Marta Román's user avatar
0 votes
2 answers
104 views

I'm trying to move data wrangling from excel to R. I have a dataframe (df) with 62 columns and 21 rows. Each of the rows represents a different organisation, and each of the column headings (apart ...
Emma541's user avatar
  • 37
0 votes
2 answers
51 views

I have the following situation: I have some data and train some linear model on it (potentially with some interaction terms). I save the coefficients of this model, so other programs than R can also ...
Noskario's user avatar
  • 906
1 vote
2 answers
2k views

I am working in R on linear regressions with covariates, looking like : lm(x ~ y + a + b + c) With the summary() function, I can get the p value corresponding to each of the variables of the model. ...
Elegance's user avatar
0 votes
0 answers
69 views

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 (...
Han's user avatar
  • 1
0 votes
0 answers
407 views

I'm having issues when I run geom_smooth. When I run my script without it my y limits are correct, however when I add geom_smooth my y values are incorrect. When I try to set a limit an error pops up ...
Heather Shaw's user avatar
0 votes
1 answer
201 views

I am interested in adding a random effect to a ggplot using stat_poly_eq(). library (ggplot2) library(ggpmisc) data (mtcars) mtcars$gear <- factor (mtcars$gear) mtcars$cyl <- factor (...
JamesR's user avatar
  • 83
1 vote
2 answers
115 views

After finding a regression prediction in lm I want to return only last two lines of the summary. What would be the best function to use? my_model_lm(y ~ x1 + x2 + x3, data = [data]) summary_result <...
Gwyrion's user avatar
  • 13
1 vote
1 answer
239 views

I have to plan a simple mediation model - https://cran.r-project.org/package=mediation library(mediation) mediation_model = lm(as.numeric(Age) ~ as.numeric(condition), data = GRA) tab_model(...
killiann's user avatar

1
2 3 4 5
39