Quantcast
Channel: Active questions tagged lm - Stack Overflow
Browsing index pages (127 articles)

Faster functions than lm() in R

I am trying to run a basic regression model in R. Previously, I always used the lm() function without any issues. However, my data frame is now too large for this function and my computer. After...

View Article


Extract regression coefficient values

I have a regression model for some time series data investigating drug utilisation. The purpose is to fit a spline to a time series and work out 95% CI etc. The model goes as follows:id <-...

View Article


If I have a variable with 3 factors can I do an lm for the effect of all 3...

Data: rentsqm area location40 4.830769 110 241 10.375799 64 342 4.168205 75 343 6.992405 54 244 7.450549 70 145 6.645718 71 146 10.481738 33 3I want to get an lm which gives additive effects of area,...

View Article

estimatr::lm_robust() estimating different coefficients from lm()

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...

View Article

Understanding `confint()` output [migrated]

ContextFrom my understanding, when doing statistical inference, e.g., estimating the mean of a population from a sample, it is possible to use a linear regression. The intercept parameter is an...

View Article


Why does my fe with demeaned data ( lm() ) not reproduce coefficients from...

I am trying to reproduce fixed effects coefficients for panel data using different packages and techniques: (1) plm(), (2) lfe(), (3) dummy-lsdv with lm(), and (4) demeaned-fe with lm().My data set...

View Article

How to estimate a regression

I am trying to replicate table 3 column 1 of “Do charter schools skim students or drain resources? ” by Thomas Dee and Helen Fu (EER, 2004).I already developed a regression model but even though I am...

View Article

Why does my fe with demeaned data ( lm() ) not reproduce coefficients from...

I am trying to reproduce fixed effects coefficients for panel data using different packages and techniques: (1) plm(), (2) lfe(), (3) dummy-lsdv with lm(), and (4) demeaned-fe with lm().My data set...

View Article


How to obtain RMSE out of lm result?

I know there is a small difference between $sigma and the concept of root mean squared error. So, i am wondering what is the easiest way to obtain RMSE out of lm function in R?randomData =...

View Article


Why does enabling long mode throw the bootloader into boot loop and mess up...

ProblemI 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 right...

View Article

R lm() weights argument being ignored when placed inside function

I am trying to figure out why the following piece of code ignores the weights argument and produces simply an unweighted regression analysis. If I remove the function wrapping everything works fine....

View Article

Image may be NSFW.
Clik here to view.

Why is there a major difference in R-Squared between my models created with...

I created two models using the lm() function in R. The first model, I created the design matrix for my prediction variable and then fed that into the lm() function.copy <-...

View Article

Image may be NSFW.
Clik here to view.

How to implement a linear model in R that takes advantage of the predict.lm...

I am trying to implement a linear model using categorical variables x1, x2, z2.where z1 is a linear combination of x1.A call to lm() will allow me to use the predict() function on new data. But, using...

View Article


Error in eval(predvars, data, env) : object 'Disorder' not found

Im trying to run a code to analyze multiple regression: model <- glm(Disorder ~ Overweight + Sex + Age + Psychol_Well_Being + Self_Rated_Health,data = (Newtaskdata,family = binomial(link = "logit"))

View Article

Interpreting interactions in a regression model [closed]

I have an experimental design where I measure some response (let's say blood pressure) from two groups: a control group and an affected group, where both are given three treatments: t1, t2, t3. The...

View Article


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

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...

View Article

Validity of forcing line through origin in multiple regression

I am trying to fit a multiple regression model to my data. I am testing the hypothesis that outcome Y is linearly related to independent variable X, while controlling for a linear relationship with...

View Article


Modify the name of factor variables in lm function(summary function)

Sample code:options(contrasts = c("contr.sum", "contr.poly"))require(datasets); data(InsectSprays)model1 <- lm(count ~ spray, data = InsectSprays) summary(model1)When I run above code (a subset of)...

View Article

Error conducting regression (stepwise) AIC is -infinity for this model, so...

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...

View Article

Error leading to identical coefficients in R lm() function?

I am running an lm() in R, and I create the dataframe using a for{} loop. For most of the coefficients they are different, however two of them ConditionC_20 and ConditionC_22 are identical.Below is the...

View Article
Browsing index pages (127 articles)


Latest Images