search for: drug

Displaying 20 results from an estimated 721 matches for "drug".

Did you mean: doug
2008 Nov 17
1
Type III ANOVA of package car depends on factor level order
## Question1: How to define IV with interaction alone, without main effects? ## Question2: Should Type III ANOVA in package car be independent of the factor level order? ## data from http://www.otago.ac.nz/sas/stat/chap30/sect52.htm drug <- c(t(t(rep(1,3)))%*%t(1:4)); disease <- c(t(t(1:3)) %*% t(rep(1,4))); y <- t(matrix(c( 42 ,44 ,36 ,13 ,19 ,22 ,33 ,NA ,26 ,NA ,33 ,21 ,31 ,-3 ,NA ,25 ,25 ,24 ,28 ,NA ,23 ,34 ,42 ,13 ,NA ,34 ,33 ,31 ,NA ,36 ,3 ,26 ,28 ,32 ,4 ,16 ,NA ,NA ,1 ,29 ,NA ,19 ,NA ,11 ,9 ,7 ,1 ,-6 ,21 ,...
2018 May 04
2
Regression model fitting
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...
2006 Jul 07
4
How to change the type of segments ends?
...segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot make it. I even tried 'arrows()', but still failed. Following is the code I use: ==================================================== drug.or <- c(1.017,1.437,1.427,2.211) drug.orl <- c(0.715,1.075,1.103,1.696) drug.oru <- c(1.446,1.922,1.845,2.882) yaxis <- seq(1,4,by=1) plot(x=drug.or,y=yaxis,type='p',pch=17,xlim=c(0,3),axes=FALSE, xlab='Odds Ratio',ylab='',main='Reference Group: A only...
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My data have a variable called "RowNo" that functions almost like a "timevar" but not quite. In Subject 6, Erlotinib has a RowNo value of 3 whereas Paclitaxel has a RowNo value of 2. So if I us...
2006 May 30
1
max / pmax
Hello R users, I am relatively new to R and cannot seem to crack a coding problem. I am working with substance abuse data, and I have a variable called "primary.drug" which is considered the drug of choice for each subject. I have just a few missing values on that variable. Instead of using a multiple imputation method like chained equations, I would prefer to derive these values from other survey responses. Specifically, I have a frequency of use...
2012 Oct 31
3
expand.grip for permutations
if i were to have a block size of 4 people and i want to assign a treatment combination to the entire block, there would be 16 different treatment combinations (TTTT, TTTP, TTPP, PTTP, etc.) i am trying to get all 16 permutations and i am able to use this code below. drugs=c('P','T'); comb=expand.grid(drugs,drugs,drugs,drugs) for a block size of 3 the code would be comb=expand.grid(drugs,drugs,drugs) and for a block size of 2 it would be comb=expand.grid(drugs,drugs). my question is whether there is a way to automatically create the comb variable....
2018 Mar 05
2
data analysis for partial two-by-two factorial design
Hi Bert, I am very sorry to bother you again. For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply. I really hope that you can do me a great favor to share your points about how to explain the coefficients for drug A and drug B if run anova model (response variable = drug A + drug B). is it different from running three separate T tests? Thank you so much!! Ding I need to analyze data generated from a partial two-by-two factorial design: two levels for drug A (yes, no), two levels for drug B (yes, no); how...
2018 Mar 05
5
data analysis for partial two-by-two factorial design
David: I believe your response on SO is incorrect. This is a standard OFAT (one factor at a time) design, so that assuming additivity (no interactions), the effects of drugA and drugB can be determined via the model you rejected: For example, if baseline control (no drugs) has a response of 0, drugA has an effect of 1, drugB has an effect of 2, and the effects are additive, with no noise we would have: > d <- data.frame(drugA = c("n","y",&q...
2018 Mar 02
3
data analysis for partial two-by-two factorial design
Dear R users, I need to analyze data generated from a partial two-by-two factorial design: two levels for drug A (yes, no), two levels for drug B (yes, no); however, data points are available only for three groups, no drugA/no drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group of no drugA/yes drugB. I think we can not investigate interaction between drug A and drug B, can I still r...
2018 Mar 05
0
data analysis for partial two-by-two factorial design
...al statisticians. Sorry that I did not tell more info about experiment design. I did not do this experiment, my collaborator did it and I only got chance to analyze the data. There are nine dishes of cells. Three replicates for each treatment combination. So randomly select three dishes for no drug A/no drug B treatment, a second three dishes for drug A only, then last three dishes to add both A and B drugs. After drug treatments, they measure DNA methylation and genes or gene expression as outcome or response variables(two differnet types of response variables). My boss might want to find...
2018 Mar 05
0
data analysis for partial two-by-two factorial design
...gt; I am very sorry to bother you again. > > For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply. > > I really hope that you can do me a great favor to share your points about how to explain the coefficients for drug A and drug B if run anova model (response variable = drug A + drug B). is it different from running three separate T tests? > > Thank you so much!! > > Ding > > I need to analyze data generated from a partial two-by-two factorial design: two levels for drug A (yes, no), two lev...
2007 Jul 05
3
summarizing dataframe at variable/factor levels
...ork but is not very efficient (could also generalize this to a function). Searched the archives and docs but didn't see anything close to this question. Cheers, dave dat.ex = data.frame( rep(c(1:6), each=6), c(rnorm(12), rnorm(12, 1), rnorm(12, 2)), rnorm(36, 5), rep(c(1:6), 6), rep(c("Drug1", "Drug2", "Placebo"), each=12) ) names(dat.ex) = c("patient.no", "outcome", "x", "time", "drug") mean of first 2 time pts on Drug1: mean.time.1.drug.1 = mean( dat.ex[dat.ex$time==1 & dat.ex$drug=="Drug1", c(...
2002 Apr 18
1
Help with lme basics
In Baron and Li's "Notes on the use of R for psychology experiments and questionnaires" http://cran.r-project.org/doc/contrib/rpsych.htm they describe a balanced data set for a drug experiment: "... a test of drug treatment effect by one between-subject factor: group (two groups of 8 subjects each) and two within-subject factors: drug (2 levels) and dose (3 levels). " This design is identical to an unbalanced one that I am interested in analyzing in R. I have both...
2018 Mar 02
0
data analysis for partial two-by-two factorial design
...to it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Mar 2, 2018 at 10:34 AM, Ding, Yuan Chun <ycding at coh.org> wrote: > Dear R users, > > I need to analyze data generated from a partial two-by-two factorial > design: two levels for drug A (yes, no), two levels for drug B (yes, no); > however, data points are available only for three groups, no drugA/no > drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group > of no drugA/yes drugB. I think we can not investigate interaction between > drug A and dr...
2012 Mar 22
4
Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!
Hello All, Want very much to learn how to plot patient drug timelines. Trouble is I need to figure out how to do this today. So not much time for me to struggle with it. Hoping someone can just help me out a bit. Below are some sample data and code that produces what I think is the beginning of a very nice graph. Need to alter the code to: 1. Get the li...
2018 Mar 05
2
data analysis for partial two-by-two factorial design
...On Mar 5, 2018, at 2:27 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > > > David: > > > > I believe your response on SO is incorrect. This is a standard OFAT (one > factor at a time) design, so that assuming additivity (no interactions), > the effects of drugA and drugB can be determined via the model you rejected: > > >> three groups, no drugA/no drugB, yes drugA/no drugB, yes drugA/yes drug > B, omitting the fourth group of no drugA/yes drugB. > > > > > For example, if baseline control (no drugs) has a response of 0, drug...
2012 Mar 30
3
Adding text for written comments to bottom of graphs
...help with others. setwd("N:/Regimen Coding/0906/Plots Test") getwd() TestData <- structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3), line = c(1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1), instance = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), drug = structure(c(1L, 2L, 1L, 2L, 3L, 1L, 2L, 3L, 4L, 1L, 2L, 2L, 1L, 3L, 4L, 3L), .Label = c("Drug A", "Drug B", "Drug C", "Drug D"), class = "factor"), pattern = structure(c(1L, 1L, 4L, 4L, 4L, 3L, 3L, 3L, 3L, 2L, 2L, 5L, 5L, 5L, 5L, 5L), .Label =...
2006 Oct 05
2
treatment effect at specific time point within mixedeffects model
...but am I confused as to why the > other coefficient estimates are now different for the time > factor if this is just a re-naming. > The coefficient estimates for the interactions are the same > for fm1 and fm1a, as expected. > > But my question relates to the signifcance of drug at a > specific time point, e.g., time = 3. The coeffecieint for > say "factor(time)3:drugP" measures the interaction of the > effect of drug=P and time=3, which is not testing what I want > to test. Based on the info below, I want to compare 3) versus 4). > > 1)...
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 2:27 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > David: > > I believe your response on SO is incorrect. This is a standard OFAT (one factor at a time) design, so that assuming additivity (no interactions), the effects of drugA and drugB can be determined via the model you rejected: >> three groups, no drugA/no drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group of no drugA/yes drugB. > > For example, if baseline control (no drugs) has a response of 0, drugA has an effect of 1, drugB...
2018 Mar 05
0
data analysis for partial two-by-two factorial design
.... Agreed. Furthermore your encoding of the treatment assignments has the advantage that the default treatment contrast for A+B will have a statistical estimate associated with it. That was a deficiency of my encoding that Ding found problematic. I did have the incorrect notion that the encoding of Drug B in the single drug situation would have been NA and that the `lm`-function would produce nothing useful. Your setup had not occurred to me. Best; David. > > "Mislead" is a subjective judgment, so no comment. The explanation I provided is standard. I used it for decades when I t...