On Fri, 4 May 2018, Allaisone 1 wrote:
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
?.
Regards
Hi,
Could you provide R-code that generates your data.frame?
Eivind
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.