Displaying 20 results from an estimated 114 matches for "time2".
Did you mean:
time
2010 Nov 15
3
merge two dataset and replace missing by 0
Hi r users,
I have two data sets (X1, X2). For example,
time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,211 )
outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26 ,15 ,12 ,6 ,2 ,1 )
X1<-cbind(time1,outpue1)
time2<-c( 0 ,8 ,15 , 22 ,43 , 64 ,85 ,106 ,148)
output2<-c( 5 ,5 ,4 ,5 ,5 ,4 ,1 ,2 , 1 )
X2<-cbind(time2,output2)
I want to merge X1 and X2 into a big dataset X by time1 and time2 so that
the missing item in output2 will be replace by 0. For example, there is no
output2 when...
2007 Jan 19
4
Newbie question: Statistical functions (e.g., mean, sd) in a "transform" statement?
Greetings listeRs -
Given a data frame such as
times
time1 time2 time3 time4
1 70.408543 48.92378 7.399605 95.93050
2 17.231940 27.48530 82.962916 10.20619
3 20.279220 10.33575 66.209290 30.71846
4 NA 53.31993 12.398237 35.65782
5 9.295965 NA 48.929201 NA
6 63.966518 42.16304 1.777342 NA
one can use "transf...
2009 Jun 29
2
Add ID numbers on a plot
Dear List,
I have (for example) 50 observations collected from 50 experimental sites and want to look at changes of 50 observations as function of time in a graph. I found that I could do that using R-code below:
time2 <- 1:25
y1=rnorm(25, mean=0, sd=1)
y2=rnorm(25, mean=0, sd=1)
...
y50=rnorm(25, mean=2, sd=1)
plot(time2, y1, type='b', xlim=range(0,30), ylim=range(y1, y2), xlab='x', ylab='y', pch="1",col=3)
points(time2, y2, type='b', col="red", xlab='x&...
2008 Apr 09
2
fuzzy merge
...20
3 2008-01-02 15:42 30
4 2008-01-02 16:45 40
5 2008-01-02 17:42 50
6 2008-01-02 20:40 60
My second data frame :
ID2 time2 d1
101 2008-01-02 14:29 75
102 2008-01-02 17:55 105
103 2008-02-07 20:01 8
I want the merging to be done such that time2 is in the range between time1...
2014 Aug 25
5
problema con campos que tienen formato fecha
...ATOS/Bases")
BASE <- read.table("Todos2014.txt", header = TRUE, sep = "\t")
#attach (BASE)
dim (BASE)
#library (lubridate)
#convertir a formato de fecha y hora
BASE <- cbind (BASE, (dmy_hms(paste(BASE$Date,BASE$Time,sep=" "))))
names (BASE)[12]<-"Time2"
#empieza rutina para calcular duración de visitas
visitas <- data.frame ()
n<-1
narbol <- 1
while (n <= dim(BASE)[1]) {
m = n
if (n < dim (BASE)[1]) {
while (BASE$Registro[m+1] == "FALSE" & m+1 <= dim(BASE)[1]) {m=m+1}
if (m+1 == dim (BASE)[1] &a...
2010 Sep 02
2
date
Hello all,
I've 2 strings that representing the start and end values of a date and
time.
For example,
time1 <- c("21/04/2005","23/05/2005","11/04/2005")
time2 <- c("15/07/2009", "03/06/2008", "15/10/2005")
as.difftime(time1,time2)
Time differences in secs
[1] NA NA NA
attr(,"tzone")
[1] ""
How can i calculate the difference between this 2 string?
Regards,
Dunia
[[alternative HTML version deleted]]
2010 Jan 12
0
Wishlist: Function 'difftime' to honor 'tzone' attribute (PR#14182)
...t is reasonable if their difference is zero.
The result is like above because the function '-.POSIXt' calls the function
'difftime', and function 'difftime' does not honor 'tzone' attribute, as can be
seen from this part of the function definition.
function (time1, time2, tz = "", units = c("auto", "secs", "mins",
"hours", "days", "weeks"))
{
time1 <- as.POSIXct(time1, tz = tz)
time2 <- as.POSIXct(time2, tz = tz)
...
}
Function 'difftime' calls 'as.POSIXct'...
2010 Jan 16
2
Extracing only Unique Rows based on only 1 Column
...alues in the other four rows, only the uniqueness
of the entries in the first row. The "unique" command does not seem to
have this option available, at least based on what I've read in the
help file.
A simplified example matrix (designated as "traveltimes"):
ID Time1 Time2
1 3 4
1 4 7
2 3 5
2 5 6
3 4 5
3 2 8
When I use a command such as
matches <- unique(traveltimes, incomparables = FALSE, fromLast = FALSE)
I will end up with a 6-row matrix, exactly what I already have. What I
would like to do is to remove the duplica...
2011 Jul 19
1
Measuring and comparing .C and .Call overhead
...und(tC_c,2))/N, "usec\n")
dyn.unload("mvMultiply.so")
--------------------------------
#code file: myMultiply.cc
#include <Rinternals.h>
#include <R.h>
#include <sys/time.h>
extern "C" {
SEXP matvecMultiply(SEXP A, SEXP x) {
timeval time1, time2;
gettimeofday(&time1, NULL);
SEXP execTime_sxp;
PROTECT(execTime_sxp = allocVector(REALSXP, 1));
double *execTime; execTime = REAL(execTime_sxp);
double *rA = REAL(A), *rx = REAL(x), *ry;
int n = length(x);
int m = length(A) / n;
SEXP y;
PROTECT(y = allocVector(REALSXP, m));
ry = REAL...
2007 Dec 16
4
improving a bar graph
...oss each of the three graphs/tie epriods?
(b) I have seen much more sophisticated examples using lattice (e.g
each person has a separate panel/plot). I am open to alternative code
as to how I could present this data.
Time1 <- c(9.0,6.0,1.0,5.0,7.0,9.0,5.0,7.5,6.0,8.0,5.0,5.0,9.0,4.0,5.0,5.0)
Time2 <- c (10,5,3,3,3,6,7,8,5,8,7,7,9,8,5,3)
Time3 <- c (10,0,3,0,0,6,0,0,0,0,0,0,0,0,0,0)
df <- rbind (Time1, Time2, Time3)
dft <- (t(df))
dft
barplot(dft, beside = TRUE, main= "Risk score by assessment", xlab =
" Score", ylab = "frequency", col="blue&q...
2009 May 15
1
Function Surv and interpretation
Dear everyone,
My question involves the use of the survival object.
We can have
Surv(time,time2,event, type=, origin = 0) (1)
As detailed on p.65 of:
http://cran.r-project.org/web/packages/survival/survival.pdf
My data (used in my study) is 'right censored' i.e. my variable corresponding to 'event' indicates whether a person is alive (0) or dead (1) at date last seen...
2014 Aug 25
2
problema con campos que tienen formato fecha
...edan ayudar.
Tengo una base de datos de la que estoy haciendo varios cálculos. Uno de
ellos es la diferencia entre tiempos para conocer la duración de un evento.
Aquí usé el paquete lubridate para tener fecha y hora en el formato
adecuado. Cuando hago el calculo obtengo algo como esto:
> (BASE$Time2[518]-BASE$Time2[516])
Time difference of 1.966667 mins
lo cual está bien. El problema es que quiero guardarlo en un data frame.
Pero cuando lo guardo se me pierden las unidades y el formato de fecha.
BASEFINAL
V1 V2 V3 V4
V5
88 1.966667...
2004 Aug 05
1
Post-hoc t-tests in 2-way repeated measure ANOVA
Hi all
I am running a 2-way repeated measure anova with 1 between-subjects
factor (Group=treatment, control), and 1 within-subject factor (Time of
measurement: time1, time2). I extract the results of the anova with:
summary(aov(effect ~ Group*Time + Error=Subj/Time, data=mydata))
Now, this must be clearly a dumb question, but how can I quickly extract
in R all the post-hoc t-tests for the simple main effects?
Also, while I am at it, how do I enter in the model a...
2010 Feb 16
3
converting character vector "hh:mm" to chron or strptime 24 clock time vectors
...$data and $time (daily, monthly averages, maxima of my $LogData for
example) so I am trying to get R to recognise the $date and $time
columns as valid dates and times. Using...
> tdata$date2 = as.Date(as.character(tdata$date))
I can get a new column of valid dates, but neither:
> tdata$time2= strptime(tdata$time,"%k")
Error in `$<-.data.frame`(`*tmp*`, "time2", value = list(sec = c(0, 0, :
replacement has 9 rows, data has 10
nor trying:
> tdata$time2=chron(times=as.character(tdata$time, format= "hh:mm"))
In addition: Warning messages:
1: In...
2008 Jun 11
1
Some problem with the OLS
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080611/2da35c97/attachment.pl>
2012 Nov 30
1
help on "stacking" matrices up
...RVAL <-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 <-matrix(c((0*INTERVAL):(7*INTERVAL)))
TIME1 <-matrix(c((0*INTERVAL):(8*INTERVAL)))
CDURINF1 <-((Dose/Tinf)*(1/(0.088*76.9)))*(1-exp(-0.088*TIME1))
CAFTINF1 <-((Dose/Tinf)*(1/(0.088*76.9)))*(1-exp(-0.088*Tinf))*(exp(-0.088*(TIME1)))
CONC1 <-ifelse(TIME1<=Tinf,CDURINF1,CAFTINF1)
CD...
2007 Dec 31
3
Survival analysis with no events in one treatment group
...About 25% of the patients have had at least one
admission, and of these, 40% have had two admissions within the 12
month period of the study. Each patients has had one of 4
treatments, and one of the treatment groups has had no admissions for
the period. I used:
surv.obj<-Surv(time=time1,time2=time2,event=event,type="counting")
model<-coxph(surv.obj~Treatment+cluster(Subject))
and, as explained in the coxph help page, I get a warning message
about convergence because the MLE of one of the coefficients is
infinite since there are no admissions in one group.
I'm lookin...
2010 Jul 23
0
calls don't hang up correctly on VM
...Spawn extension (default, 99, 4) exited non-zero on 'SIP/170-00000000'
-- Executing [h at default:1] Set("SIP/170-00000000", "CDR(userfield)=
Hangupcause:16") in new stack
-- Executing [h at default:2] Verbose("SIP/170-00000000", "details - time
time2 status ") in new stack
details - time time2 status
-- Executing [h at default:3] GotoIf("SIP/170-00000000", "0?end-call,s,1")
in new stack
-- Executing [h at default:4] Verbose("SIP/170-00000000", "details - time
time2 status ") in new sta...
2008 May 09
1
predicting from coxph with pspline
Hello.
I get a bit confused by the output from the predict function when used
on an object from coxph in combination with p-spline, e.g.
fit <- coxph(Surv(time1, time2, status)~pspline(x), Data)
predict(fit, newdata=data.frame(x=1:2))
It seems like the output is somewhat independent of the x-values to
predict at. For example x=1:2 gives the same result as x=21:22. Does the
result span the x-values in the original data set so that if I want to
predict a value at...
2011 Sep 26
3
survival analysis: interval censored data
hello:
my data looks like:
time1 time2 event catagoria
2004 2006 1 C
2004 2005 0 C
2005 2010 1 E
2007 2009 1 C
2006 2007 0 E
2008 2010 0 C
2008 2010 1 E
...
and the census interval...