Displaying 20 results from an estimated 6000 matches similar to: "spaghetti plot - categorical variable differentiated by color"
2010 May 14
1
color lines by group membership in spaghetti plot
Greetings,
I am new to R. Right now I'm most interested in the spaghetti plots
of achievement over time by student ID associated with longitudinal
analysis. How can I do a spaghetti plot of all students, but color
the lines by group membership such as gender or race, and indicate
this color scheme in the legend? Any advice would be much appreciated.
Jack
Jack B. Monpas-Huber, Ph.D.
2012 Apr 04
3
spaghetti plots in R
I would like to plat some spaghetti plots from my data , ma data is as
follows
ak[1:3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[,8] [,9]
[1,] 0.3211745 0.4132568 0.5649930 0.6920562 0.7760113 0.8118568 0.8609301
0.9088819 0.9326736
[2,] 0.3159234 0.4071270 0.5579212 0.6844584 0.7684690 0.8243702 0.8677043
0.8931288 0.9261926
[3,] 0.3075260 0.3993699
2009 Mar 22
1
Estimating LC50 from a Weibull distribution
I am attempting to estimate LC50 (analogous to LD50, but uses exposure
concentration rather than dose) by fitting a Weibull model; but I
can't seem to get it to work. From what I can gather, I should be
using survreg() from the survival package. The survreg() function
relies on time-to-event data; my data result from 96 h exposures
(i.e., dead or alive after a fixed period; 96 h). I've
2011 Sep 03
1
Problem with by statement for spaghetti plots
Hi,
I am trying to apply the example at the bottom of the following page to my
own data:
http://128.97.141.26/stat/R/faq/spagplot.htm
http://128.97.141.26/stat/R/faq/spagplot.htm
The code from the example is:
/tolerance<-read.table("http://www.ats.ucla.edu/stat/R/faq/tolpp.csv",sep=",",
header=T)
fit <- by(tolerance, tolerance$id,function(x) fitted.values(lm(tolerance
2012 Aug 07
2
Passing arguments to a function within a function ...
Hallo Everybody
How do you specify arguments for a function used within another function?
Here is my problem:
I am reconstructing a calculator for the burden of disease due to air
pollution from publications and tools published by the WHO. The
calculations make use of published dose-response relationships for
particular health end-points. This is then applied to populations with
known or
2006 Feb 03
0
Cause of Error 1:nrow(X) : argument NA / NaN
Dear R Helpers
I am trying to get function smedian.hilow to work using Hmisc summarize
on variable conc in dataframe pkindivmtd by time and dose using:
attach(pkindivmtd)
sconc <- summarize(conc,llist(time,dose),smedian.hilow)
I get the error message
Erreur dans 1:nrow(X) : argument NA / NaN
Contents of pkindivmtd is
> contents(pkindivmtd)
Data frame:pkindivmtd 1296 observations
2006 Apr 20
2
nlminb( ) : one compartment open PK model
All,
I have been able to successfully use the optim( ) function with
"L-BFGS-B" to find reasonable parameters for a one-compartment
open pharmacokinetic model. My loss function in this case was
squared error, and I made no assumptions about the distribution
of the plasma values. The model appeared to fit pretty well.
Out of curiosity, I decided to try to use nlminb( ) applied to
a
2017 Jul 19
0
spaghetti plot - urgent
Hi Rosa,
You pass a vector to ggplot, which expects a data.frame. I am sure you
meant to do this:
point7$y_point7 <- point7$beta0_7 + point7$beta1_7*point7$time + point7
$epsilon_7
ggplot(point7, aes(time, y_point7)) + geom_line()
HTH
Ulrik
On Wed, 19 Jul 2017 at 20:37 Rosa Oliveira <rosita21 at gmail.com> wrote:
> Hi everyone,
>
> I?m trying to do a spaghetti plot and I
2017 Jul 19
2
spaghetti plot - urgent
Hi everyone,
I?m trying to do a spaghetti plot and I know I?m doing all wrong, It must be.
What I need:
15 subjects, each with measurements over 5 different times (t1, ..., t5), and the variable that I need to represent in the spaguetti plot is given by:
PCR = b0 + b1 * ti + epsilon
B0, - baseline of each subject
B1 - trajectory of each subject over time (so multiply by t)
Epsilon - error
2011 Mar 01
2
regression with categorical nuisance variable
Hi,
I am new to R, so I am unsure of the formula to set up this analysis.
I would like to run a linear model with a continuous dependent
variable (brain volume) and a continuous independent variable (age)
while controlling for a categorical nuisance variable (gender).
Age and brain volume are correlated.
There are no gender differences in age but there are significant
gender differences in brain
2008 Nov 11
1
using newdata in survfit with categorical variable
Hi R-helpers,
I was trying to put gender='Male' in newdata to create a expected survival curve for a pseudo cohort by using survfit based on Cox regression. My codes are shown below:
fit<- coxph(Surv(end, status2)~gender, data=wlwsn1)
Summary(fit)
coef exp(coef) se(coef) z p
genderMale 0.204 1.23 0.0912 2.23 0.025
2005 Jan 24
0
Follow-up on nls convergence failure with SSfol
A couple of weeks ago there was a question regarding apparent
convergence in nls when using the SSfol selfStart model for fitting a
first-order pharmacokinetic model. I can't manage to find the original
message either in my archive or in the list archives but the data were
time conc dose
0.50 5.40 1
0.75 11.10 1
1.00 8.40 1
1.25 13.80 1
1.50 15.50 1
2006 Feb 12
1
lme, nlsList, nlsList.selfStart
Dear listers,
I am trying to fit a model using nlsList() using alternately a SSfol()
selfstart function or its developped equivalent formulae.
This preliminary trial works well
mydata<-groupedData(Conc~Tps|Organ,data=mydata)
mymod1<-nls(Conc~SSfol(Dose,Tps,lKe,lKa,lCl),data=mydata)
as well as a developped form:
mymod2<-nls(Conc~Dose * exp(lKe+lKa-lCl) *
2012 Jul 09
1
Correcting for overdispersion
Hello,
I am trying to determine LD50 and LD95 using dose.p in MASS however some of the Residual variance is larger than the degrees of freedom. Please can anyone help with any advice as to how i can correct for this?
Here is the model as inputted into R
y<-cbind(dead,n-dead)
model<-glm(y~log(conc),binomial)
summary(model)
xv<-seq(min(log(conc)-1),max(log(conc)+1),0.01)
2005 Jul 19
2
Michaelis-menten equation
Dear R users:
I encountered difficulties in michaelis-menten equation. I found
that when I use right model definiens, I got wrong Km vlaue,
and I got right Km value when i use wrong model definiens.
The value of Vd and Vmax are correct in these two models.
#-----right model definiens--------
PKindex<-data.frame(time=c(0,1,2,4,6,8,10,12,16,20,24),
2012 Nov 26
1
Help on function please
Dear All,
I could use a bit of help here, this function is hard to figure out (for me at least) I have the following so far:
PKindex<-data.frame(Subject=c(1),time=c(1,2,3,4,6,10,12),conc=c(32,28,25,22,18,14,11))
Dose<-200
Tinf <-0.5
defun<- function(time, y, parms) {
dCpdt <- -parms["kel"] * y[1]
list(dCpdt)
}
modfun <- function(time,kel, Vd) {
out <-
2005 Jan 06
1
nls - convergence problem
Dear list,
I do have a problem with nls. I use the following data:
>test
time conc dose
0.50 5.40 1
0.75 11.10 1
1.00 8.40 1
1.25 13.80 1
1.50 15.50 1
1.75 18.00 1
2.00 17.00 1
2.50 13.90 1
3.00 11.20 1
3.50 9.90 1
4.00 4.70 1
5.00 5.00 1
6.00 1.90 1
7.00 1.90 1
9.00 1.10 1
12.00 0.95 1
14.00
2010 Apr 26
1
finite difference scheme for 2D differential equations
Hello everyone,
I am trying to solve 2D differential equations using finite difference
scheme in R. I have been able to work with the equations with only one
spatial dimensions but I want to extend it to the two dimensional problem.
For example i can simulate one dimensional diffusion using a code like the
following. But I want to write a similar code for,say, a two dimensional
diffusion
2006 Dec 14
2
xyplot: discrete points + continuous curve per panel
I have a number of x, y observations (Time, Conc) for a number of Subjects
(with subject number Subj) and Doses. I can plot the individual points with
xyplot fine:
xyplot(Conc ~ Time | Subj,
Groups=Dose,
data=myData,
panel = function(x,y) {
panel.xyplot(x, y)
panel.superpose(???) # Needs more here
}
)
I also like to plot on
2023 Jul 02
0
How to plot both lines and points by group on ggplot2
Thank you that is exactly it!
The problem was to connect each point of the series 'Conc' with a line.
Best regards
Luigi
On Sat, Jul 1, 2023 at 8:33?PM Chris Evans <chrishold at psyctc.org> wrote:
>
>
> On 01/07/2023 19:20, Luigi Marongiu wrote:
> > Hello,
> > I have a dataframe with measurements stratified by the concentration
> > of a certain substance.