[R] Regression model fitting

Allaisone 1 Allaisone1 at hotmail.com
Fri May 4 17:20:37 CEST 2018

Hi all ,

I have a dataframe (Hypertension) with following headers :-

> Hypertension

ID   Hypertension(before drug A)      Hypertension(On drug A)        On drug B?      Healthy diet?

1            160                                                           90                                           True                  True

2            190                                                          140                                          False                 False

3             170                                                          110                                         True                  False

I wanted to study whether patients on drug A + on drug B + on healthy diet would have better

blood pressure control (reduction) compared to patients with drug A but not on drug B or not on healthy diet or not on both.

I considered my outcome(y) variable to be hypertension measurements for all patients

on drug A (column 2).  Columns 1,3 and 4  are my explanatory(x) variables variables(column 1 is just the baseline measurements to adjust for the effect of drug A compared to the baseline) . So my regression formula using lm() function in R is as follow :-

Regression <- lm (formula= Hypertension(On drug A)~Hypertension(before drug A) +

(On drug B?*Healthy diet?))  , data = Hypertension)

I expect that the result of "(On drug B?*Healthy diet?)" coefficient in the model would give the correct answer to my question.

Is this the best formula to answer my question or there would be better methods ?.


	[[alternative HTML version deleted]]

More information about the R-help mailing list