Displaying 20 results from an estimated 9000 matches similar to: "nlme function examples for dose-respone"
2012 Sep 17
3
eval(parse(...)) only once in a function
Hi
I would like to have something like
str <- "df$JT == 12"
fun <- function(df) {
b <- eval(parse(str))
return(b)
}
but for performance "eval(parse(a))" should not be evaluated at each
function call, but should work as
fun <- function(df) {
b <- df$JT == 12
return(b)
}
Do you have an idea how I can implement this?
Thx
Christof
2012 Oct 02
3
lattice xyplot, get current level
Hi
xyplot(y ~ x | subject) plots a separate graph of y against x for each
level of subject. But I would like to have an own function for each
level. Something like
xyplot(y ~ x | subject,
panel = function(x,y) {
panel.xyplot(x,y)
panel.curve(x,y) {
# something that dependents on the current subject
...
}
})
How I get the current
2012 Oct 26
2
connect points in charts
Hi
is there a automatic way that long distances between points are not
connected. I have something like
plot(x,y,type="o",...)
atx <- seq(as.Date("2009-04-01"),as.Date("2011-04-01"),"month")
axis.Date(1, at=atx,labels=format(atx, "%b\n%Y"), padj=0.5 )
but I do not want lines between points whose distance is greater than
two weeks.
thx
2012 Jul 02
2
save conditions in a list
Hi
how would you save conditions like
a = "day > 100"; b = "val < 50"; c = "year == 2012"
in a list? I like to have variables like "day", "val", "year" and a list
of conditions list(a,b,c). Then I want to check if a & b & c is true or
if a | b | c is true or similar things.
Greetings
Christof
2012 Aug 14
3
self-starter functions for y = a + b * c^x
Hi
there are some predefined self-start functions, like SSmicmen, SSbiexp,
SSasymp, SSasympOff, SSasympOrig, SSgompertz, SSflp, SSlogis, SSweibull,
Quadratic, Qubic, SSexp (nlrwr)
Btw, do you know graphic examples for this functions?
The SSexpDecay (exponential decay) for y = (y0 - plateau)*exp(-k*x) +
plateau from
2012 Jan 20
3
break an axis.POSIXct
Hi
I like to use "axis.POSIXct" to plot days from 2006 till 2008. But I
only have datas for the summer months. Is it possible to get two axis
breaks, to have not so long distances without points?
thx
Christof
2012 Jan 09
2
RODBC vs gdata
Hi
one col in my Excel file contains many numbers. But on line 3000 and
some other lines are strings like "FG 1". "RODBS" seems to omit this
lines. "gdata" works, but is much slower.
Is this a bug of RODBC or do I apply it wrong?
Example with the same "file.xlsx"
library(RODBC); excel <- odbcConnectExcel2007("file.xlsx")
tab <-
2011 Nov 26
2
simplify source code
Hi
I would like to shorten
mod1 <- nls(ColName2 ~ ColName1, data = table, ...)
mod2 <- nls(ColName3 ~ ColName1, data = table, ...)
mod3 <- nls(ColName4 ~ ColName1, data = table, ...)
...
is there something like
cols = c(ColName2,ColName3,ColName4,...)
for i in ...
mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...)
I am looking forward to help
Christof
2011 Dec 09
1
apply on function with vector as result
Hi,
a have some code like
myfunc <- function(x) { ...; return c(a,b) }
ys <- sapply(0:100,myfunc)
so I get something like c(c(a1,b1),c(a2,b2),...)
But now I need the "as" and "bs" in one vector
as <- apply(ys, function(c(a,b)) a)
bs <- apply(ys, function(c(a,b)) b)
Can you help me with the correct syntax, instead of my pseudo code?
thx
Christof
2012 Jul 21
1
alternative to rbind for data.table
Hi
I want to add a row to a "data.table" in each round of a for loop.
"rbind" seems to be a inefficient way to implement this.
How would you do this? The "slow" solution:
library(data.table)
Rprof("test.out")
dt <- data.table()
for (i in (1:10000)) {
# algorithm that generates a list with different values,
# but same key-names, each round, for
2007 Apr 17
2
how to estimate dose from respond given drc package result
Dear all,
I can use the very nice drc package (multdrc()) to model and plot a
dataframe containing dose and response values. I can also use
predict.drc() to yield response values given a dose. I need to do the
opposite, estimate a dose given the response. The general predict
documentation seems to say that this is possible, but it does not
appear that predict.drc has that capability.
2013 Jul 23
1
optimize integer function parameters
Hi
I have "observations" obs <- (11455, 11536, 11582, 11825, 11900, ...)
and a simulation function f(A,B,C,D,E,F), so sim <- f(A,B,C,D,E,F)
e.g. sim = c(11464, 11554, 11603, 11831, 11907, ...)
now I would like to fit A,B,C,D,E,F such that "obs" and f(A,B,C,D,E,F)
match as well as possible. A,..,F should be integers and have bounds.
How would you solve this problem
2002 Jul 16
3
dose.p in MASS
Dear all
I need to obtain an estimate of the 50% lethal dose (LD50) from a
logistic regression model obtained by applying the glm procedure to
some binomial data. The model appears to fit the data very well. I
used dope.p from MASS to try and find LD50.
The following output appears:
> dose.p(iso.glm.logit, cf = c(1,3), p = 1:3/4)
Error in dose.p(iso.glm.logit, cf = c(1, 3), p = 1:3/4) :
2007 Jul 12
1
dose-response on a grid
I have the following problem. I have measured a dose response curve
(binary response, continuous dose) on a grid of x,y positions. I would
like to produce a grey-level plot that shows the LD50 at each (x,y)
position.
I am thinking that I have to do something like
fit<-glm(resp ~ x*y + dose, family = binomial)
Corrections welcome.
But from here I don't know how to get LD50, and certainly
2008 Oct 28
3
Dose Profile
Hi Everyone,
I have data in a long format e.g. there is one row per patient but each
follow-up appointment is included in the row. So, a snippet of the data
looks like this:
TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2
Time2 B1001029 LTG M 15719 30/04/2003 15825 150 106 29/08/2003 15946 200
227 B1117003 LTG M 15734 30/04/2003 15825 200 91 03/09/2003 15951 250 217
2002 Aug 27
5
probit etc. for dose-response modeling
Hello all
I have done some fitting of pnorm functions to dose-response data, so I could
calculate EC50 values (dose where the response is 0.5). I used the nlm function
for this, so I did not get any information about the confidence intervals of
the fitted parameters.
What would be a good way to do such a probit fit, or is there a package which I
could use?
Best regards
Johannes Ranke
2006 Jun 15
1
Repost: Estimation when interaction is present: How do I get get the parameters from nlme?
Gday,
This is a repost since I only had one direct reply and I remain
mystified- This
may be stupidity on my part but it may not be so simple.
In brief, my problem is I'm not sure how to extract parameter
values/effect sizes from a nonlinear
regression model with a significant interaction term.
My data sets are dose response curves (force and dose) for muscle that
also have two
2007 Mar 20
1
Error in nlme with factors in R 2.4.1
Hi,
the following R lines work fine in R 2.4.0, but not in R 2.4.1 or any devel versions of R
2.5.0 (see below for details).
library(drc) # to load the dataset 'PestSci'
library(nlme)
## Setting starting values
sv <- c(0.43355869, 2.49963220, 0.05861799, 1.73290589, 0.38153146, 0.24316978)
## No error
m1 <-
nlme(SLOPE ~ c + (d-c)/(1+exp(b*(log(DOSE)-log(e)))),
fixed =
2009 Apr 18
3
Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well
Hi£¬
I found that Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well. Maybe, somebody who have solved this problem can help me.
Thanks for your attention!
[[alternative HTML version deleted]]
2000 Jan 06
1
nlme
Among others, datam contains the columns: logconc, tm, dose, subj, bilirubin.
None of these are factor variables.
The following compartment models work (the first still has not
converged after 100 interations):
res1 <- nlme(logconc~p2+p3+log(dose/(exp(p1)-exp(p2))*
(exp(-exp(p2)*tm)-exp(-exp(p1)*tm))),start=list(fixed=c(5,-2,-0.1)),
fixed=list(p1+p2+p3~1),control=list(maxIter=100),