Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Dennis Murphy
Hi: On Fri, Oct 15, 2010 at 4:29 AM, Anh Nguyen wrote: > Thank you for the very helpful tips. Just one last question: > - In the lattice method, how can I plot TIME vs OBSconcentration and TIME > vs PREDconcentration in one graph (per individual)? You said "in lattice > you would replace 'smooth

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Ista Zahn
On Fri, Oct 15, 2010 at 7:29 AM, Anh Nguyen wrote: > Thank you for the very helpful tips. Just one last question: > - In the lattice method, how can I plot TIME vs OBSconcentration and TIME vs > PREDconcentration in one graph (per individual)? You said "in lattice you > would replace 'smooth' by '

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Anh Nguyen
Thank you for the very helpful tips. Just one last question: - In the lattice method, how can I plot TIME vs OBSconcentration and TIME vs PREDconcentration in one graph (per individual)? You said "in lattice you would replace 'smooth' by 'l' in the type = argument of xyplot()" that just means now t

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Anh Nguyen
I tried that too, it doesn't work because of the way I wrote the code. Listing y as free or not giving it a limit makes the scale go from -0.5 to 0.5, which is useless. This is what my code looks like now (it's S-Plus code, btw)-- I'll try reading up on lattices in R to see if I can come up with so

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Dennis Murphy
Hi: To get the plots precisely as you have given them in your png file, you're most likely going to have to use base graphics, especially if you want a separate legend in each panel. Packages ggplot2 and lattice have more structured ways of constructing such graphs, so you give up a bit of freedom

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread David Winsemius
On Oct 15, 2010, at 3:46 AM, Anh Nguyen wrote: Hello Dennis, That's a very good suggestion. I've attached a template here as a .png file, I hope you can view it. This is what I've managed to achieve in S- Plus (we use S-Plus at work but I also use R because there's some very good R package

Re: [R] Time vs Concentration Graphs by ID

2010-10-15 Thread Anh Nguyen
Hello Dennis, That's a very good suggestion. I've attached a template here as a .png file, I hope you can view it. This is what I've managed to achieve in S-Plus (we use S-Plus at work but I also use R because there's some very good R packages for PK data that I want to take advantage of that is n

Re: [R] Time vs Concentration Graphs by ID

2010-10-14 Thread Anh Nguyen
I found 2 problems with this method: - There is only one line for predicted dose at 5 mg. - The different doses are 5, 7, and 10 mg but somehow there is a legend for 5,6,7,8,9,10. - Is there a way to make the line smooth? - The plots are also getting a little crowded and I was wondering if there a

Re: [R] Time vs Concentration Graphs by ID

2010-10-14 Thread Ista Zahn
Hi, Assuming the data is in a data.frame named "D", something like library(ggplot2) # May need install.packages("ggplot2") first ggplot(D, aes(x=Time, y=Concentration, color=Dose) + geom_point() + geom_line(aes(y = PredictedConcentration, group=1)) + facet_wrap(~ID, scales="free", ncol=3) should

[R] Time vs Concentration Graphs by ID

2010-10-14 Thread thaliagoo
Hello-- I have a data for small population who took 1 drug at 3 different doses. I have the actual drug concentrations as well as predicted concentrations by my model. This is what I'm looking for: - Time vs Concentration by ID (individual plots), with each subject occupying 1 plot -- there is to