search for: xdata

Displaying 20 results from an estimated 115 matches for "xdata".

Did you mean: data
2005 Feb 24
4
r: functions
hi all i have a function that uses two inputs, say xdata and ydata. An example is the following, simple1<-function(xdata,ydata) { ofit<-lm(ydata~xdata) list(ofit) } say i use arbitray number for xdata and ydata such that D = x1 x2 y 1 1 10 2 6 6 3 10 7 x<-D[,1:2] and y<-D[,3] if one uses these inputs and rund the program we get th...
2008 Sep 10
3
writing simple function through script
Hi all, I try to write a simple function in a script. The script is as follows yo<-function(Xdata) { n<-length(Xdata[,1]) Lgm<-nls(formula=LgmFormula, data=Xdata, start=list(a=1500,b=0.1),weights=Xdata$Qe) return(Lgm) } After the execution of the script, when I call the function yo on data called NC60.DATA I get an error. #yo(NC60.DATA) Erreur dans eval(expr, envir, enclos) : ob...
2012 Dec 27
2
Bootstrap
...65, 66, 66, 67, 68, 69, 69, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 76, 78, 79, 81, 81, 84, 84, 85, 88, 91," tengo un data frame con 4 variables y uso las 4 para generar el modelo, pero no entiendo porque me da este error (la variable en question es la xdata[,1]) muchas gracias! library (bootstrap) n <- 1794 theta <- function(xdata) { coef(glm(xdata[,2]~xdata[,1]+xdata[,3]+xdata[,4],xdata , family=binomial))[4] } results <- bootstrap(1:n,1000,theta,xdata) [[alternative HTML version deleted]]
2008 Dec 18
1
using jackknife in linear models
...tions of more complex data structures, # write theta so that its argument x # is the set of observation numbers # and simply pass as data to jackknife the vector 1,2,..n. # For example, to jackknife # the correlation coefficient from a set of 15 data pairs: xdata <- matrix(rnorm(30),ncol=2) n <- 15 theta <- function(x,xdata){ cor(xdata[x,1],xdata[x,2]) } results <- jackknife(1:n,theta,xdata) So I tried: DF <- as.data.frame(matrix(rnorm(250), ncol=5)) attach(DF) model.lm <- formula(V1 ~ V2 + V3 + V4) n <- 50 theta &...
2009 Jun 17
0
nls with weights
...the bottom-parameter to min(yData)??? Can anybody explain, why it ends up with: "singular gradient" 8< ------------------------------------------------------- >8 sigmoid <- function(x, bottom, top, slope, logec50) { bottom + (top - bottom) / (1 + 10^((logec50-x)*slope)) } xData <- seq(-10,10,1.2) yData1 <- sigmoid(xData,10,1,-0.2,3) + rnorm(1:length(xData), sd = 0.5) yData2 <- sigmoid(xData,10,1,-0.2,3) + rnorm(1:length(xData), sd = 0.2) yData3 <- sigmoid(xData,10,1,-0.2,3) + rnorm(1:length(xData), sd = 1.1) yMat <- rbind(yData1, yData2, yData3) yData <...
2012 Sep 13
1
[LLVMdev] Parsing C++ template parameters using cindex.py
..."cursor", node.spelling print tabs + " location", node.location node_type_res = node.type.get_result() print tabs + " result", node_type_res.kind print tabs + " kind", node.kind DeepPrintType(node.type, depth + 1) print tabs + " xdata", node.xdata print tabs + " data", node.data[0], node.data[1], node.data[2] print tabs + " children" children = [c for c in node.get_children()] for c in children: DeepPrint(c, depth + 2) index = Index.create() tu = index.parse(None, ['testfile...
2008 Jun 24
2
persp plot
...for the z-axis. z1 z2 ... z(M*N) Once I have the three data files created I use them in the following R script: cat << EOF | R --no-save def.par <- par(no.readonly = TRUE) en_range <- c(-6.2, 0.0) om_range <- c(-200.0, 500.0) ze_range <- c(0.0, 1.0) z_perspective <-c(0,3) xdata <- scan("x.txt", list(0)) ydata <- scan("y.txt", list(0)) zdata <- scan("z.txt", list(0)) f <- function(xdata,ydata) { rr <- zdata; rr } z <- outer(xdata, ydata, f) pdf(file="persp.pdf",height = 8, width =8) persp(xdata, ydata, z, axes =...
2009 Jun 25
2
Error: system is computationally singular: reciprocal condition number
...<- function(x,y,z,method="p",na.rm=T){ x <- c(x) y <- c(y) z <- as.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) } xdata <- na.omit(data.frame(data[,c(1,2)])) Sxx <- cov(xdata,xdata,m=method) xzdata <- na.omit(data) xdata <- data.frame(xzdata[,c(1,2)]) zdata <- data.frame(xzdata[,-c(1,2)]) Sxz <- cov(xdata,zdata,m=method) zdata <- na.omit(data.frame(data[,-c(1,2)]))...
2012 Feb 11
1
object not found - Can not figure out why I get this error: Error in NROW(yCoordinatesOfLines) : object 'low' not found
...wn. I have created following function: require(quantmod) # Add horizontal line to graph produced by quantmod::chart_Series() add_HorizontalLine<-function(yCoordinatesOfLines, on=1, ...) { lenv <- new.env() lenv$add_horizontalline <- function(x, yCoordinatesOfLines, ...) { xdata <- x$Env$xdata xsubset <- x$Env$xsubset x0coords <- rep(1, NROW(yCoordinatesOfLines)) x1coords <- rep(NROW(xdata[xsubset]), NROW(yCoordinatesOfLines)) if ((NROW(x0coords) > 0) & (NROW(x1coords) > 0)) { segments(x0coords,...
2009 May 05
2
Stepwise logistic Regression with significance testing - stepAIC
...he function stepAIC (“MASS”) for choosing an optimal model. However I am not sure if stepAIC considers significance properties like Likelihood ratio test and Wald test (see example below).     > y <- rbinom(30,1,0.4) > x1 <- rnorm(30) > x2 <- rnorm(30) > x3 <- rnorm(30) > xdata <- data.frame(x1,x2,x3) > > fit1 <- glm(y~ . ,family="binomial",data=xdata) > stepAIC(fit1,trace=FALSE)   Call:  glm(formula = y ~ x3, family = "binomial", data = xdata)   Coefficients: (Intercept)           x3      -0.3556       0.8404    Degrees of Freedom:...
2003 Oct 24
5
how to remove NaN columns ?
How can I remove columns with NaN entries ? Here is my simple example: > data <- read.csv("test.csv") > xdata <- data[3:length(data)] > xs <- lapply(xdata, function(x){(x - mean(x))/sqrt(var(x))}) > x <- data.frame(xs) > x C D E F 1 -0.7071068 NaN -0.7071068 -0.7071068 2 0.7071068 NaN 0.7071068 0.7071068 I am sure it is possible to r...
2006 Nov 12
2
Need help in waveslim package: imodwt and universal.thresh.modwt
Hi: I have encountered problems with imodwt and universal.thresh.modwt and cannot find any reference in R Search. Hope someone can give me some ideas: Starting with modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine (1) ydata <- imodwt(modwt.la8) will always give ydata as numeric(0) (no values) instead of being a time series data with the same lenght as xdata. (2) thred.la8 <- universal.thresh.modwt(modwt.la8, max.level=4, h...
2012 Aug 28
3
date in plot, can't add regression line
...ydata~xdates) <------ this fails, can't do dates as below abline(xylm, col="black") > lm(ydata~xdates) Error in model.frame.default(formula = ydata ~ xdates, drop.unused.levels = TRUE) : invalid type (list) for variable 'xdates' So I try this instead (method 2): xdata <- 1:length(tradeflavorbyday$timestamp[tradeflavorbyday$tradeflavor == 1]) ydata <- tradeflavorbyday$x[tradeflavorbyday$tradeflavor == 1] xylm <- lm(ydata~xdata) <------ now this works, great abline(xylm, col="black") The problem now is that I can't get the dates onto...
2010 Apr 24
3
S4 Inheritance of environments
...an answer to this. My apologies if it has already been answered. If it has, a pointer to the relevant discussion would be greatly appreciated. Creating S4 classes containing environments exhibits unexpected behavior/features.? These have a different in two ways: 1) slotName for the data: ".xData" instead of ".Data" and do not respond to the 2) Response to the is.* function seems to indicate that the object does not know of its inheritance. ( Notably, the inherits function works as expected. ) Here is a working illustration: > # LIST > setClass( 'inheritList'...
2003 May 30
2
Need help installing qtoolbox
I have windows version of R v1.6.2 I have downloaded the qtoolbox.zip from http://www.cmis.csiro.au/S-PLUS/qtoolbox/ My R command line is > install.packages("C:/Program Files/R/qtoolbox.zip", .libPaths()[1], CRAN = NULL) and I get the following error message: updating HTML package descriptions Warning message: error -1 in extracting from zip file > Is there another way to
2008 Jul 25
3
Bug in gap.plot
Hi, all I am trying to make a plot with a axis break and I want the whole plot to be line, not points. However, when I execute the following command half of the graph is points and the other lines. gap.plot(Xdata, Ydata,gap=c(5,6),gap.axis="x",type="l") I think it might be a bug in plotrix. I would greatly appreciate your input. If there is another way to do it, I would greatly appreciate it. Best wishes, Art Roberts University of Washington Department of Medicinal Chemistry Seattl...
2006 Nov 14
1
??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Airon, I used R2.4.0 on a Windows XP (SP2) (not Chinese :-)) and it still works: > data = read.csv("u:/airon.csv") > xdata = data$Adj..Close > modwt.la8 = modwt(xdata, "la8", n.level=6) > summary(modwt.la8) Length Class Mode d1 1467 -none- numeric d2 1467 -none- numeric d3 1467 -none- numeric d4 1467 -none- numeric d5 1467 -none- numeric d6 1467 -none- numeric s6 1467 -none- numeric...
2010 Oct 04
2
Recursion error after upgrade to R_2.11.1 [Sec=Unclassified]
...too deeply: infinite recursion / options(expressions=)? This occurs in the initialize method of S4 classes where I was initialising attributes eg: .Object[['realtimeState']] <- list() I can avoid this new error by altering the code to do: .Object$realtimeState <- list() OR .Object@.xData$realtimeState <- list() My classes all extend .environment and store all changeable data as per above (in environment .xData slot) rather than in normal class slots because I am able to achieve much quicker execution times without all the copy-on-change cost that results from passing these obje...
2009 Jul 13
0
Partial Correlation
...* print("inside listwise")* * if(na.rm == T){* * data = na.omit(data)* * }* * * * xdata <- na.omit(data.frame(data[,c(1,2)])) #i1,C1* * print("printing xdata.......................................")* * print(xdata)* * Sxx <- cov(xdata,xdata,m=method)* * print("Sxx........
2010 Nov 16
1
Force evaluation of variable when calling partialPlot
...that works for me is to call importance as follows: sel.imp <- importance(sel.rf, class=NULL, scale=TRUE, type=NULL) and then use the 'names' of the imp data frame to be absolutely clear to RF you are talking about the same variables for(i in length(sel.imp){ partialPlot(sel.rf,xdata,names(sel.imp[i]),which.class=1,xlab=vars[i],main="") } Hope that helps. Tim Howard >>>>>>>>>>> Date: Mon, 15 Nov 2010 12:29:08 -0800 (PST) From: gdillon <gdillon@fs.fed.us> To: r-help@r-project.org Subject: Re: [R] Force evaluation of variabl...