Displaying 20 results from an estimated 300 matches similar to: "number of patients in a hospital on a given date"
2006 Nov 29
1
Extract some character from a character vector of length 1
the content of th character vector (of length 1) is as follows:
a <- "something2 ....pat1 name1 pat2 something2....pat1 name2
pat2....pat1 name3 pat2 "
I would like to extract the character bewteen pat1 and pat2. That's to
say, I would like to get a vecter of c("name1", "name2","name3").
What I did is use strsplit() twise. But I wonder if there
2010 Jun 26
2
Recoding dates to session id in a longitudinal dataset
Hi,
I'm fairly new to R but I have a large dataset (300000 obs) containing
patient material. Some patients came 2-9 times during the three year
observation period. The patients are identified by a unique idnr, the
sessions can be distinguished using the session date. How can I recode the
date of the session to a session id (1-9). This would be necessary to obtain
information and do some
2009 Apr 21
3
Deleting rows or cols that do not meet cut off
How can I delete both rows and columns that do not meet a particular cut off value.
Example:
> d <- rbind(c(0, 1, 6, 4),
+ c(2, 5, 7, 5),
+ c(3, 6, 1, 6),
+ c(4, 4, 4, 4))
> f <- as.matrix(d)
> f
[,1] [,2] [,3] [,4]
[1,] 0 1 6 4
[2,] 2 5 7 5
[3,] 3 6 1 6
[4,] 4 4 4 4
I would like to delete all
2006 Mar 25
7
Regexp subexpression
I can't get the PERL subexpression translated to R. Following, for example,
B. Ripley's
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/58984.html
I am using sub, but it looks like an ugly substitute. Assume I want to
extract the first alpha part and the first numeric part, but only if they
are in sequence.
Do I really have to use the sub twice, first extracting the first variable,
then
2005 May 18
1
from list to dataframe
I was wondering if someone can help me figure out the following:
I have two patient datasets, ds1 and ds2. ds1 has fields "patid", "date",
and "lab1". ds2 has "patid", "date", and "lab2". I want to find all the
patids that have at least 2 dated records for each lab. I started by
splitting each dataset by patid, to create ds1.list
2004 Sep 22
1
impenetrable warning
Dear R-help,
Can anyone explain the meaning of the warning,
Singular precision matrix in level -1, block 1
? Or how to track down where it comes from?
More precisely, using the nlme package, I'm issued with the warning
itt2 <- lme(lrna~rx.nrti+lbrna, random=~1|patid,
cor=corExp(form=~days|patid,nugget=T), weights=varPower(
form=~lbrna),data=rna3)
Warning messages:
1: Singular
2012 Nov 17
3
manipulating longitudinal data in r
Dear list member,
I have the following data example
ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1,1,2))
I want to add another variable b, such that the max of 'a' by id is returned
i.e data ke becomes
ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1,1,2),b=c(2,2,2,1,2,2))
Any help will be appreciated.
Oluwakemi
[[alternative HTML version deleted]]
2005 May 24
3
obtaining first and last record for rows with same identifier
I have a dataframe that contains fields such as patid, labdate, labvalue.
The same patid may show up in multiple rows because of lab measurements on
multiple days. Is there a simple way to obtain just the first and last
record for each patient, or do I need to write some code that performs that.
Thanks,
Steven
2010 Mar 29
1
how to prove that the factor makes no difference
Dear R-helper,
Please suggest some methods for my question below.
We measured the amount of protein A in patient blood in pre-treatment and
post-treatment condition from 32 patients.
--------------------------------------------
Pre-treatment Post-treatment
Pat1 25 28
Pat2 19 15
Pat3 94
2012 Dec 08
2
Why my lapply doesn't work with FUN=as.Date
Hi, guys
I don't understand why I can apply as.Date to a single item in the list:
> as.Date(alldays[4])
[1] "29-03-20"
but when I try to lapply as.Date to all the items, i got a sequence of neg
numbers:
> sapply(alldays[1:4], FUN=as.Date)
03-04-2012 02-04-2012 30-03-2012 29-03-2012
-718323 -718688 -708492 -708857
does anyone know what's wrong here?
i am
2007 Mar 27
1
basic handling of data.frame
Hello,
I'm new to R but wan't to use it to compute the statistics of my medical study.
The study includes several parameters for a number of patients. Each
parameter was assessed by a number of readers, once with a special
condition, once without.
Now I have a data.frame with colums like:
PatientID, ReaderID, SpecialCond(yes/no), Parameter1, Parameter2.....
the rows are not sorted, and
2007 Mar 06
2
how to edit my R codes into a efficient way
Hello, Everyone,
I am a student an a new learner of R and I am trying to do my homework
in R. I have 10 files need to be read and process seperately. I really
want to write the codes into something like "macro" to save the lines
instead of repeating 10 times of similar work.
The following is part of my codes and I only extracted three lines for
each repeating section.
data.1 <-
2008 Nov 19
2
Exclude holidays in a subset of dates?
Hi All,
I am iterating through dated materials, with variable start and end dates,
and would like to skip procedures everytime I encounter a weekend or
holiday. To do this, I thought the easiest way would be to create a
TRUE/FALSE vector corresponding to each day where it is TRUE if a workday,
and FALSE if a weekend or holiday.
So far I have been able to do this for weekdays:
startDate <-
2008 Oct 31
1
subset with variable number of subset arguments
I've got a big data.frame from which I need to extract data based on a variable number of Id's (InfCode).
Until now I've been using the following dull solution as I never needed to search for more than 5 codes.
Now my needs have increased faster than my R skills did and I need to call my function with about 25 values for x.
There has to be a *apply or even simpler solution which
2010 Oct 21
2
nested anova
Hello all,
Can any of you R gurus help me out? I?m not all that great at stats to
begin with, and I?m also learning the R ropes (former SAS user).
Here?s what I need help with? I have a nested sample design and ran a
nested anova, but I don?t know how to interpret the results
habitat (four different types) is nested in site (three types), and site is
nested in gear (two types)
2007 Jan 24
2
keep track of selected observations over time
Dear all,
Attached is a description of my data, graph and the problem which I need help with. Hope you have time to open the file and help me out.
Many thanks,
Jenny
---------------------------------
2005 Nov 16
1
PPC package-ppc.read.raw.nobatch (PR#8316)
Full_Name: Martin O'Gorman
Version:
OS:
Submission from: (NULL) (84.176.63.149)
I have been looking at the PPC package and have a question. As the input data is
comma separated, shouldn?t the command to read in the raw (no batch) mass spec
data indicate that sep=?,? (marked below) ? Otherwise, the data read in is the
pair of values (m/z,intensity). It is not obvious why that should be.
2009 Oct 26
1
regular expressions
Dear list,
I have the following text to parse (originating from readLines as some
lines have unequal size),
st = c("START text1 1 text2 2.3", "whatever intermediate text", "START
text1 23.4 text2 3.1415")
from which I'd like to extract the lines starting with "START", and
group the subsequent fields in a data.frame in this format:
text1 text2
2006 Aug 15
0
Help with workaround for: Function '`[`' is not in thederivatives table
Earl F. Glynn asks:
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Earl F. Glynn
> Sent: Tuesday, 15 August 2006 8:44 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Help with workaround for: Function '`[`' is not in
thederivatives table
>
> # This works fine:
> > a <- 1
2007 Jan 25
1
X-UID gaps cause Dovecot/IMAP to hang
Hi,
When the Dovecot 1.0.rc19 IMAP server encounters X-UID headers with
gaps in them, it hangs indefinitely. I've attached a sample mailbox (in
mbox format) which repeatably exhibits this behavior. The mbox contains
only three messages with the following X-UIDs in order: 774, 785, 787.
If I remove the X-UID headers from each message, Dovecot handles the
mailbox without any problems. UW-IMAP