Hi all , I have a dataframe (Hypertension) with following headers :-> HypertensionID 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 [[alternative HTML version deleted]]
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 at 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. >
These is essentially a statistical question, which are generally consider off topic here. So you may not get a satisfactory reply. stats.stackexchange.com is probably a better venue for your post. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, May 4, 2018 at 8:20 AM, Allaisone 1 <Allaisone1 at hotmail.com> 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 > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.