Skip to main content

All Questions

0 votes
0 answers
15 views

Power analysis for multiple regression with binary moderator - Determining sample size

I want to conduct an a priori power analysis to determine the necessary sample size for a proposed project. I will estimate a regression between two continuous variables with a binary moderator (...
medusa's user avatar
  • 45
0 votes
1 answer
239 views

R forcing computation of interaction term estimates for reference level when it shouldn't

I am trying to run different sets of regression models with fixed effects uisng feols from the fixest package in R. I run into issues where R forces me to compute the interaction of the reference ...
flâneur's user avatar
  • 637
0 votes
0 answers
97 views

Three-way interaction in regression does not show the interaction terms and estimates

I'm running a linear regression model with a 3-way interaction, and the model runs, but it does not give me the actual interactions, how can I check if there's any interaction between the 3 terms (...
Ajna F Kertesz's user avatar
1 vote
0 answers
15 views

Various linear regressions that activate in linear regression within the same model

I want to create a linear regression of the next sort: $$Y=(1-\sigma)(\alpha_i + \beta_i x)+ \sigma(\alpha_j+\beta_j x)+\varepsilon$$ Where sigma refers to different time periods. I want to run it ...
emithemex's user avatar
1 vote
1 answer
306 views

Three-Way Interactions Missing in Multiple Regression Model with 4 Predictors?

I have four predictors that are meant to predict a variable called "quit", and I'm trying to run a multiple regression model to look at how they interact. However, when the model returns its ...
strugging_student's user avatar
0 votes
0 answers
943 views

How do I write a linear model with multiple variables using ggplot in R?

Imagine if my linear regression model was: lm(y~x + N * P) -> (the multiplication is for an interaction) How would I plot this using ggplot? That all variables are used in the linear regression ...
FvD99's user avatar
  • 11
2 votes
1 answer
685 views

How to include 3 interactions with a SINGLE predictor in lmer

I know that I could use lm(a ~ (b + c + d)^2) in order to get all possible two-way interactions in a model, but I need only the interactions with a single predictor. Let's say I want the possible ...
Larissa Cury's user avatar
0 votes
0 answers
801 views

How to calculate the partial R squared for a linear model with factor interaction in R

I have a linear model where my response Y is say the percentage (proportion) of fat in milk. I have two explanatory variables one (x1) is a continuous variable, the other (z) is a three level factor. ...
Jmmer's user avatar
  • 11
0 votes
1 answer
2k views

Interaction terms of the same variable with multiple variables

I have a model lm = a ~ b I would like to include c, d , e that represent interactions terms with b => lm = a ~ b + b:c + b:d + b:e. Is there a rapid way to obtain this result without taping ...
Shunrei's user avatar
  • 329
5 votes
1 answer
3k views

Multiple Regression with Interaction

I've come across somewhat of a confusing topic relating to the syntax of multiple regression with explanatory variables and their interactions. A DataCamp explanation led me to think that: lm(formula =...
galinfia's user avatar
0 votes
1 answer
491 views

Compare treatment effects in three way interaction between two continuous variables and one categorical variable in R

I am trying to run a linear regression model which contains continuous variable A * continuous variables B * categorical variable (treatments with 4 levels). Data can be download here. Model<-lm(...
huang xiaoyu's user avatar
1 vote
1 answer
2k views

Interact_plot keeps coming back with Error: data must be compatible with existing data

I have been trying to solve this for days, so any help would be appreciated! I am trying to make an interaction plot for an OLS Regression. This is the code I am using: interact <- lm(ele$vt_c ~ ...
Lucia Thomas's user avatar
2 votes
0 answers
140 views

Interaction effects in regression models - should I include the dummy coding reference group?

I have a question about coding interaction effects using dummy coding which I’d be really grateful for your advice on please. Imagine I want to design an experiment to measure the impact of amount of ...
george_psych's user avatar
0 votes
0 answers
36 views

Stratifying Interaction in R

I have been putting in these codes: race_caucasian <- lm(ds$BMI~ds$User+ds$Age+ds$Female+ds$Insurance+ds$Income+ds$Vaccine+ds$Nonsmoker,data=subset(phrnew,Caucasian=="1")) And race_other ...
Biostatistician in training 's user avatar
0 votes
1 answer
417 views

Interpreting overall effect if main and interaction effects are present?

Let's supoose, I have three Independent categorical variables e, f and g and would like to estimate the dependent variable y. After some work, I come with the following regression model: y = b0 + b1*...
Patrick Balada's user avatar

15 30 50 per page