Displaying 20 results from an estimated 102 matches for "tdata".
Did you mean:
data
2010 Feb 16
3
converting character vector "hh:mm" to chron or strptime 24 clock time vectors
Hi All,
I am attempting to work with some data from loggers. I have read in a
.csv exported from MS Access that already has my dates and times (in 24
clock format), (with StringsAsFactors=FALSE).
> head(tdata)
LogData date time
1 77.16 2008/04/24 02:00
2 61.78 2008/04/24 04:00
3 75.44 2008/04/24 06:00
4 89.43 2008/04/24 08:00
5 95.83 2008/04/24 10:00
6 96.88 2008/04/24 24:00
I wish to be able to summarise the data...
2012 May 25
1
Multiple rms summary plots in a single device
...k on my system. Please advise regarding options that must
be specified to "plot(summary(", or in the construction of my loop.
Below are sample code and my sessionInfo(). Please note that I am
using data.table to facilitate my "real analysis", but I can replicate
the issue with tData as a data.frame (using seg <- subset(tData,
groups == segment) logic), but I included the data.table logic in case
it may be having some influence. Thank you!
Mike
tData <- data.frame(groups=as.factor(1:8), low=as.factor(1:4)
,high=as.factor(seq(100, 400, 100)), rand=runif(400))
tData &...
2010 Nov 03
4
Drawing circles on a chart
Dear Group,
I have the following data matrix which is a timeseries.
> dput(tData)
structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09,
0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01,
0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06,
-0.08, -0.07), D = c(-0.15, -0.05, -0.1, -0.03, -0.13, -0.04,
-0.1, -0.04, -0.15), E = c(-0.17, -0.16, -0.08,...
2013 Apr 17
1
Bug in VGAM z value and coefficient ?
...ata=data.frame("y"=x[,1]*10,"x"=x[,2])))
summary(vglm("y~x",family=hypersecant,data=data.frame("y"=x[,1],"x"=x[,2])))
summary(vglm("y~x",family=hypersecant,data=data.frame("y"=x[,1]*10,"x"=x[,2])))
*Ex 2*
library(VGAM)
tdata <- data.frame(x2 = runif(nn <- 1000))
tdata <- transform(tdata, y1 = rt(nn, df = exp(exp(0.5 - x2))),
y2 = rt(nn, df = exp(exp(0.5 - x2))))
fit1 <- vglm(y1 ~ x2, studentt, tdata, trace = TRUE)
tdata$y1=tdata$y1*100
fit2 <- vglm(y1 ~ x2, studentt, tdata, trac...
2009 May 11
0
Partial correlation function required
...s.data.frame(z)
if(dim(z)[2] == 0){
stop("There should be given data\n")
}
data <- data.frame(x,y,z)
if(na.rm == T){
data = na.omit(data)
}
- Ignored:
# recursive formula
if(dim(z)[2] == 1){
tdata <- na.omit(data.frame(data[,1],data[,2]))
rxy <- cor(tdata[,1],tdata[,2],m=method)
tdata <- na.omit(data.frame(data[,1],data[,-c(1,2)]))
rxz <- cor(tdata[,1],tdata[,2],m=method)
tdata <- na.omit(data.frame(data[,2],data[,-...
2010 Jul 19
0
to extend data.frame or not ... that is the question
..."incident_type")]),
responses=unique(from[,c("incident_num", "unit",
"response_time")]))
})
### define methods
setMethod("head", "CAD",
function(x, n=5, row.names=NULL, optional=FALSE, ...){
tdata = merge(x@responses, x@incidents, by="incident_num",
all.x=TRUE)
head(tdata, n=n, row.names=row.names, optional=optional)
})
setMethod("tail", "CAD",
function(x, n=5, row.names=NULL, optional=FALSE, ...){
tdata = merge(x@respons...
2009 Feb 07
3
Output results to a single postscript document
...tely then piece them
back together into
one document..
Thanks in Advance for any help!
options (scipen=999, digits=7)
library(foreign)
library(Hmisc)
library(prettyR)
library(DAAG)
library(lmtest)
library(car)
library(MASS)
library(nlme)
library(dyn)
library(wle)
library(lasso2)
library(zoo)
tdata <- ts(read.table("C:/tmp/data.csv" ,sep = ",",header=TRUE))
print(tdata)
res <- function(dep, indep, fn, env = parent.frame()) {
depnm <- deparse(substitute(dep))
indepnm <- deparse(substitute(indep))
fo <- sprintf("%s ~ lag(%s, -1) +...
2009 Feb 03
1
How to show variables used in lm function call?
...rmula = dyn(Y ~ lag(Y, -1) + XVARY)) -----> this is what I want to
see
(see simplified version of the code and output below)
Thanks in advance for any help!!
options (scipen=999, digits=7)
library(Hmisc)
library(DAAG)
library(car)
library(MASS)
library(nlme)
library(dyn)
library(zoo)
tdata <- ts(read.table("C:/R/testing/data.csv" ,sep = ",",header=TRUE))
print(tdata)
coeff <- function(dep, indep) {
mod <- dyn$lm(dep ~ lag(dep, -1)+ indep)
summ <- summary(mod)
res <- list(COEF=summ) }
out <- coeff(tdata[ ,"Y"], td...
2016 Apr 23
2
Data Frame Column Name Attribute
...mes?). So
when i run HEAD(DATAFRAMENAME) i get the column name = "Open". but you
can see below... it is called "newcol2 with some attribute called open.
I did a lot of google searches but really could not find what i was looking
for. Any help is greatly appreciated. Thank you!
tdata[["newcol2"]] <- rbind(0,apply(tdata["Open"],2,diff))
> str(tdata)
'data.frame': 7505 obs. of 8 variables:
$ Date : int 19860709 19860710 19860711 19860714 19860715 19860716
19860717 19860718 19860721 19860722 ...
$ Open : num 9.14 9.45 9.3 9.08 8.71 ......
2002 Aug 12
1
question about cloud() in lattice package
Hi all,
I have been previously been using scatterplot3d package to create some graphs but unfortunately it does not allow me to rotate the
plot on all three axis. The cloud() function in the lattice package does allow me to do so. When I was using scatterplot3d I was
using a script (Shown Below) to calculate the mean, quartiles and range limits for all three axis and I was representing that on the
2005 Jan 07
3
Basic Linear Algebra
I don't normally have to go anywhere near this stuff , but it seems to me that this should be a straight-forward process in R.
For the purposes of this enquiry I thought I would use something I can work out on my own.
So I have my matrix and the right hand results from that matrix
tdata <- matrix(c(0,1,0,-1,-1,2,0,0,-5,-6,0,0,3,-5,-6,1,-1,-1,0,0),byrow = T,ncol = 5)
sumtd <- c(0,0,0,-2)
> tdata
[,1] [,2] [,3] [,4] [,5]
[1,] 0 1 0 -1 -1
[2,] 2 0 0 -5 -6
[3,] 0 0 3 -5 -6
[4,] 1 -1 -1 0 0
> sumtd
[1] 0 0 0 -2
&g...
2005 Nov 02
2
Orientation of tickmarks labels in boxplot/plot
Hi,
I have been trying draw tickmark labels along
the y - axis perpendicular to the y axis while
labels along the x - axis parallel to x axis
while making box plot.
Here is my test dataset.
TData
ID Ratio
1 0 7.075
2 0 7.414
3 0 7.403
4 0 7.168
5 0 6.820
6 0 7.294
7 0 7.238
8 0 7.938
9 1 7.708
10 1 8.691
11 1 8.714
12 1 8.066
13 1 8.949
14 1 8.590
15 1 8.714
16 1 8.601
boxplot(Ratio ~ ID, data=TData)
makes box plot with tickmark labels parallel to the y - axis...
2018 May 01
4
issue with model.frame()
...an example that does not use the survival library.
# first create a data set with many long names
n <- 30? # number of rows for the dummy data set
vname <- vector("character", 26)
for (i in 1:26) vname[i] <- paste(rep(letters[1:i],2), collapse='')? # long variable names
tdata <- data.frame(y=1:n, matrix(runif(n*26), nrow=n))
names(tdata) <- c('y', vname)
# Use it in a formula
myform <- paste("y ~ cbind(", paste(vname, collapse=", "), ")")
mf <- model.frame(formula(myform), data=tdata)
match(attr(terms(mf), "term.l...
2012 May 30
5
problem with ifelse
Dear all,
?The code below is used to generate interval censored data but unfortunately there is an error with the ifelse which i am not able to rectify.
?Can somebody help correct it for me.
Thank you
t<-rexp(20,0.2)?
v<-c(0,m,999)?
y<-function(t,v){
? z<-numeric(length(t ((
? ? s<-numeric(length(t ((
? ? ? for(i in 1:length(t)){
? ? ? ? for(j in 1:length(v-1))?
? ? ? ? { ifelse
2011 Apr 15
1
Whole genome searching of 100bp "D" sequence
...seqnames = rep(i,nrow(mp)),
ranges = IRanges(start = mp[[1]],
end = mp[[1]]+(mp[,2]-1)),
strand = rep("+", nrow(mp)))
#OL <- findOverlaps(query=gr, subject=annotGr)
OL.p <- annotGr[(!is.na(match(annotGr, gr)))]
#as.data.frame(OL) ## view the results
#tdata.p <- annotGr[unique(queryHits(OL)),]
#tdata.p <- as.data.frame(tdata.p, row.names = NULL, optional = FALSE)
#write.table(tdata.p, paste(i,"plus.txt"))
cat( paste(i,"plus.txt\n"))
}
OL.m <- NULL
if(nrow(mm) > 0)
{
##### MATCH THE MINU...
2007 Aug 23
1
Estimate Intercept in ARIMA model
Hi, All,
This is my program
ts1.sim <- arima.sim(list(order = c(1,1,0), ar = c(0.7)), n = 200)
ts2.sim <- arima.sim(list(order = c(1,1,0), ar = c(0.5)), n = 200)
tdata<-ts(c(ts1.sim[-1],ts2.sim[-1]))
tre<-c(rep(0,200),rep(1,200))
gender<-rbinom(400,1,.5)
x<-matrix(0,2,400)
x[1,]<-tre
x[2,]<-gender
fit <- arima(tdata, c(1, 1, 0), method = "CSS",xreg=t(x))
I try to fit a ARIMA model and aclude some other independent
variable in t...
2010 Nov 02
1
Setting the names of a data.frame
I have tData as below. I need to set the names with the headers from the
first row in sHeaders
Sorry .. forgot how to set the names from row in another data frame .. pls
advise.
names(tData) = sHeaders[1,] does not work correctly
Also, why doesn't drop.levels(sHeaders) not work?
dput(tData)
structure(li...
2011 Feb 17
2
Regresión lineal para una serie temporal
Hola a todos
Estoy intentando hacer un análisis rápido de una serie temporal de datos
diarios pero me encuentro con algunos problemas. Me gustaría en primera
instancia hacer una regresión lineal pero no encuentro la forma.
Tras leer los datos diarios creo un objeto de la clase zoo y sobre éste
no puedo utilizar lm(). He leído algo sobre dynlm pero no encuentro la
forma.
Se agradece
2017 Jun 14
1
spurious warning in ave()
Consider the following simple data set and a call to ave:
> tdata <- data.frame(f1=c(1,1,1,1,2,2,2,2), f2=c(1,2,1,2,1,1,1,1), y=1:8)
> with(tdata, table(f1, f2))
f2
f1 1 2
1 2 2
2 4 0
> with(tdata, ave(y, f1, f2, FUN=max))
[1] 3 4 3 4 8 8 8 8
Warning message:
In FUN(X[[i]], ...) : no non-missing arguments to max; returning -Inf
There are...
2012 Jul 23
1
mboost vs gbm
...better. This seems
odd. This issue is meaningful since the output of this regression needs to
be implemented in a production system, and mboost doesn't even expose the
ensembles.
# default params for blackboost are a gaussian loss, and maxdepth of 2
m.mboost = blackboost(Y ~ X1 + X2, data=tdata, weights=t.ipcw,
control=boost_control(mstop=100))
m.gbm = gbm(Y ~ X1 + X2, data=tdata, weights=t.ipcw,
distribution="gaussian", interaction.depth=2, bag.fraction=1, n.trees=2500)
# compare IPCW weighted squared loss
sum((predict(m.mboost, newdata=tdata)-tdata$Y)^2 * t.ipcw) <
sum((pr...