search for: results1

Displaying 11 results from an estimated 11 matches for "results1".

Did you mean: results
2012 Mar 01
2
'break' function in loop
...o do is (1) permute ''or'' first; (2) doing t-test if this ''or'' pass criteria 1 (k=1); (3) end the loop when I get 10 permutations; (4) redo everything again but this time use criteria 2 (k=2) (I have more criteria 1:n). Somehow using my script, the final dataset (results1) only contains the result from criteria 1 (twice!) but not the result from criteria 2. I guess probably I put the break function under the wrong loop but I cannot fix it. Sorry if the whole script looks quite messy, I will be very appreciate if someone can help me fix this problem or probably give...
2011 Feb 09
1
Iterate over a list of input files?
...n = "^[T]", full.names=TRUE) # Create a data.frame with the A = read.csv(Files[1], header=FALSE)[,c(1,7)] A[,1] = as.Date(A[,1], format="%m/%d/%Y") ASum <- with(A,aggregate(V7 ~ V1, FUN = sum)) colnames(ASum) = c("Date","PL") # Merge the two data frames Results1 <- merge(DateRange , ASum, by.x = "TradingDate", by.y = "Date", all.x=TRUE) Results1$PL[is.na(Results1$PL)] <- 0 DateRange[1:10,] A[1:10,] ASum[1:10,] Results1[1:20,] Files It produces this list of results: (file list trimmed) > DateRange[1:10,] [1] "2009-06...
2013 Oct 15
1
Problem with lapply
...uot; and the corresponding p-Value. So I thought of making a list of 'cor.test's and then extract the needed values with a for loop. What I did so far... dataset=Testcor dataset$DATE<-as.Date(dataset$DATE,"%Y-%m-%d") firm.names=colnames(dataset)[2:length(colnames(dataset))] cor.results1=lapply(firm.names,function(x)cor.test(as.formula(paste(firm.names[firm.names==x],Market)),data=dataset,na.action=na.exclude)) But I always get error messages like Error in paste(firm.names[firm.names == x], Market) : object 'Market' not found or (when I attach dataset) Error in parse(t...
2012 Feb 08
1
How indices calculated in package "boot"
...th this command and used "boot", I got different results. Specifically, below are the codes for illustration. (1) The typical way by generating indices in the package: boot1 <- function (data, indices) { d <- data[indices] return(d) } AA <- c(1:10) require(boot) set.seed(123) results1 <- boot(data= AA, statistic=boot1, R=100) (2) The alternative way by calculating "indices" myself: boot2 <- function (data,indices) { indices <- sample(data, replace=TRUE) d <- data[indices] return(d) } AA <- c(1:10) set.seed(123) results2 <- boot(data= AA, statisti...
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
..."list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")? #Please advise. a <- data.frame(x=c(1,2,3),y=c(5,7,9)) b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4)) c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4)) results1 <- list(a,b,c) #what I want #but this is how I need to get there temp <- list(a,b) #results2 <- fun?????(temp2,c) # I need help here --------------------------------- [[alternative HTML version deleted]]
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
...library(Parallel) nCores <- 4 cl <- makeCluster(nCores) registerDoParallel(cl) trials = 100000 x <- iris[which(iris[,5] != "setosa"),c(1,5)] t2 <- system.time({ r2 <- foreach(icount(trials), .combine=cbind) %dopar% { ind <- sample(100,100,replace= TRUE) results1 <- glm(x[ind,2]~x[ind,1],family=binomial(logit)) coefficients(results1) }})[3] stopCluster(cl) Another interesting behavior is that I can now stop R code that should be running on the slave workers where as previously I had to use a kill command to handle the workers. I have checked th...
2009 Jul 28
3
Help with significance. T-test?
...nts, for example a somewhat normal distribution. That's difficult of course when the values in question are only "0" and "1"... Has anybody any ideas? Thanks a lot, Mika PS: The data I have looks something like this (of course I actually have 500 values, not only 10): results1: 0,1,1,1,0,1,1,0,1,0 accuracy: 0.6 results2: 0,0,1,1,0,0,1,1,1,0 accuracy: 0.5 -- View this message in context: http://www.nabble.com/Help-with-significance.-T-test--tp24699690p24699690.html Sent from the R help mailing list archive at Nabble.com.
2007 May 30
2
How to search with limit by field
Hello, I have a ferret index with 2 fields: Acts_as_ferret :fields => [:client, :content] If I do model.find_by_contents(query) I obtain all results by the query but I would like to obtain 3 results for each client. Any ideas? Thanks for all. -- Posted via http://www.ruby-forum.com/.
1997 Oct 23
0
R-beta: why restart()
...like an invitation to > bad programming to me. It's needed when comparing, say, the time to convergence (if at all) of various iterative processes, for each of a few hundred simulated values. For example one wants basically function(data){ summary<-rep(NA,1000) for(i in 1:1000){ results1<-prog1(data[i]) results2<-prog2(data[i]) . . . summary[i] <- f(results1,results2,...) } summary } where prog1, say, can sometimes fail fatally, for certain data values. The *object of the exercise* is to find out what values cause program i to crash but program j to run ok....
2011 Nov 29
2
aggregate syntax for grouped column means
...m7", "600m7")), .Names = c("var1", "var2", "id"), row.names = c(NA, -45L), class = "data.frame") > head(myData) var1 var2 id 1 31.59 33.78 0m4 2 32.21 33.25 0m4 3 31.78 NA 0m4 4 31.34 32.05 0m5 5 31.61 32.59 0m5 6 31.61 NA 0m5 results1 <- aggregate(. ~ id ,data=myData,FUN=mean,na.rm=T) head(results1,1) # id var1 var2 # 1 0m11 30.79 32.27 library(data.table) mydt <- data.table(myData) setkey(mydt,id) results2 <- mydt[,lapply(.SD,mean,na.rm=TRUE),by=id] head(results2,1) # id var1 var2 # [1,] 0m11 30.84 32....
2012 Apr 06
2
read multiaple files within one folder
...,360)) listfile<-dir("C:\\PHD\\Climate Data\\Wind\\") for (i in c(1:1460)) { Testarray <- file(listfile[i], "rb") Testarray[i,,]<- readBin(conne, integer(), size=2, n=360*720, signed=F) results <- mean(listfile[[(i*4):(i*4+3)]]) results1<- writeBin(results) close(conne) } Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/read-multiaple-files-within-one-folder-tp4537394p4537394.html Sent from the R help mailing list archive at Nabble.com.