Displaying 20 results from an estimated 8000 matches similar to: "Using string vectors as for loop arguments"
2008 May 30
0
imputationlist, update, and recode
I'm stumbling my way through manipulating data in multiply imputed datasets,
and have run into a problem translating code I used to run on my pre-imputed
dataset to multiple datasets. The imputation runs just fine, as does the
reading of the mi data sets into an imputationList. I run into trouble,
though, when I try to construct a scale across all the data sets. Is there
a simple way to do
2008 Feb 14
1
write output in a custom format
Hi,
I need to create a text file in the following format,
> 1 100.0 0
> 0 0
> 1 1
> 0 0
> 1 1
> #
> 1 100.0 0
> 0 0
> 0 1
> 1 0
> 1 1
...
where # is part of the format and not a R comment.
Each block (delimited by #) consists of a first line with three
values, call it dose, and a list of (x,y) coordinates which are a
matrix or data.frame,
>
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 Nov 25
2
cat not evaluated before file.choose
As part of a larger function I have code similar to the reduced
example below. The user is instructed to choose a file, which gets
read using read.csv. In this example, I just have the name of the
file print out.
When I call this function with choosefile(), the file dialog box
appears before the first cat line is printed. After I choose a file,
both cat lines are printed.
choosefile
2012 Nov 30
1
help on "stacking" matrices up
Dear All,
#I have the following code
Dose<-1000
Tinf <-0.5
INTERVAL <-8
TIME8 <-matrix(c((0*INTERVAL):(1*INTERVAL)))
TIME7 <-matrix(c((0*INTERVAL):(2*INTERVAL)))
TIME6 <-matrix(c((0*INTERVAL):(3*INTERVAL)))
TIME5 <-matrix(c((0*INTERVAL):(4*INTERVAL)))
TIME4 <-matrix(c((0*INTERVAL):(5*INTERVAL)))
TIME3 <-matrix(c((0*INTERVAL):(6*INTERVAL)))
TIME2
2005 Sep 05
1
convergence for proportional odds model
Hey, everyone,
I am using proportional odds model for ordinal responses in dose-response experiments. For some samll data, SAS can successfully provide estimators of the parameters, but the built-in function polr() in R fails. Would you like to tell me how to make some change so I can use polr() to obtain the estimators? Or anyone can give me a hint about the conditions for the existance of MLE
2011 Dec 21
1
Looping over files
Hi,
?I have a list of files in one of my working directories:
"chr17.chunk1.dose.fvd"
"chr17.chunk1.dose.fvi"
"chr17.chunk1.prob.fvd"?
"chr17.chunk1.prob.fvi"?
...........
.........
........
"chr17.chunk10.dose.fvd"
"chr17.chunk10.dose.fvi"
"chr17.chunk10.prob.fvd"
"chr17.chunk10.prob.fvi"
And I am
2004 Aug 19
3
List dimention labels to plots of components
It is frustrating to see the labels I want in the dimensions of a list but not be able to extract those labels into titles for plots generated from component objects. If someone could set me straight, I would appreciate it. For your amusement, I have provided an example of the Byzantine code I am currently using to avoid loops:
# Simulate ANOVA type test data
sex<-c(rep(1,8),rep(0,8))
2011 May 03
2
Change the names of a dataframe
Dear list,
This may sound silly. What is the right way to change the names of a
dataframe? Let's say I have this data frame (dose) with four columns with
names "ID", "DOSE", "TIME" "CMT". I want to change "DOSE" to "AMT". So I did
names(dose[2])<-'AMT'
But nothing happened. The name of the second column is still
2005 Jun 22
1
A question on time-dependent covariates in the Cox model.
I have a dataset with
event=death
time (from medical examination until death/censoring)
dose (given at examination time)
Two groups are considered, a non-exposed group (dose=0), an exposed group
(dose between 5 and 60).
For some reason there is a theory of the dose increasing its effect over
time (however it was only given (and measured) once = at the time of
examination).
I tested a model:
2003 Jul 24
5
inverse prediction and Poisson regression
Hello to all, I'm a biologist trying to tackle a "fish" (Poisson Regression) which is just too big for my modest understanding of stats!!!
Here goes...
I want to find good literature or proper mathematical procedure to calculate a confidence interval for an inverse prediction of a Poisson regression using R.
I'm currently trying to analyse a "dose-response"
2012 Oct 02
3
Integration in R
Dear R-users,
I am facing problem with integrating in R a likelihood function which is a
function of four parameters. It's giving me the result at the end but
taking more than half an hour to run. I'm wondering is there any other
efficient way deal with. The following is my code. I am ready to provide
any other description of my function if you need to move forward.
2010 Oct 04
2
Plot for Binomial GLM
Hi i would like to use some graphs or tables to explore the data and make
some sensible guesses of what to expect to see in a glm model to assess if
toxin concentration and sex have a relationship with the kill rate of rats.
But i cant seem to work it out as i have two predictor
variables~help?Thanks.:)
Here's my data.
>
2010 Mar 24
1
Converting a data set from 'long' format to 'interval' format
Hi,
I have a data set in which the variable 'dose' is time-varying. Currently,
the data set is in a long format, with 1 row for each time unit of follow-up
for each individual "Id". It looks like this:
orig.data <- cbind(Id = c(rep(1,4), rep(2,5)), time = c(1:4, 1:5), dose =
c(1,1,1,0,1,0,1,1,0))
orig.data
Id time dose
[1,] 1 1 1
[2,] 1 2 1
[3,] 1
2008 Jul 03
3
Re membering the last time an event occurred within a dataframe
All,
I am constructing a pharmacokinetic dataset and have hit a snag. The dataset
can be demonstrated in the following way:
myData <- data.frame(
evid = c(1, 0, 0, 0, 1, 0, 1, 1, 1, 0),
time = 1:10,
last.dose.time = c(1, 1, 1, 1, 5, 5, 7, 8, 9, 9)
)
The evid field is an indicator variable for whether the associated
observation is a dosing record (when it takes value 1) or an
2012 Oct 14
1
PFIM 3.2
Dear R-user,
I'm having some difficulty with working PFIM 3.2, a package for
implementing population PK/PD in R. I wish to evaluate the determinant of
Fisher information matrix each time with successive dose from a pre defined
sequence of doses and want to store those values in a vector. It's
important to note that in my 'stdin.r' file, dose<-c(u) and each time u is
to be
2005 Jun 15
1
anova.lme error
Hi,
I am working with R version 2.1.0, and I seem to have run into what looks
like a bug. I get the same error message when I run R on Windows as well as
when I run it on Linux.
When I call anova to do a LR test from inside a function, I get an error.
The same call works outside of a function. It appears to not find the right
environment when called from inside a function. I have provided
2009 Mar 08
1
re shaping a data frame with multiple IDs
Dear R-experts,
I have the following "long" data frame:
ID <-
2010 Apr 02
1
lineplot.CI in "sciplot": option "ci.fun" can't be changed?
hi List and Manuel,
I have encounter the following problem with the function "lineplot.CI".? I'm running R 2.10.1, sciplot 1.0-7 on Win XP.? It seems like it's a scoping issue, but I couldn't figure it out.
Thanks!
...Tao
> lineplot.CI(x.factor = dose, response = len, data = ToothGrowth)??? ## fine
> lineplot.CI(x.factor = dose, response = len, data = ToothGrowth,
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