search for: tab2

Displaying 20 results from an estimated 37 matches for "tab2".

Did you mean: tab
2010 Jul 25
1
Left Outer Join 2 DF's on Multiple Conditions
Hi, I am trying to execute the following SQL statement using two data frames: tab1, tab2 : Two Tables Select tab1.*, tab2.*, tab1.tobiiTime - tab2.ruiTime as timeDiff, IFNULL(n-m, -9999999) as alwaysIncrement FROM tab1 LEFT OUTER JOIN tab2 On tab1.data1 - tab2.mouseX = 0 And tab1.data2 - tab2.mouseY = 0 I am trying to do the following in R:- *#Getting error here:*...
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500, and I need to count the number of cells containing a count of 1 for each of the factors values defining the first dimension. Here is my attempt: tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM)) tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0)) tab3<-apply(tab2,1,sum) Computing tab2 is very slow. Is there a faster and/or more elegant way of doing this? -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at...
2010 Apr 24
2
table command
Hi, Let s be a dataframe. > s A B C 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 > tab1=table(s[,c(1,2)]) > tab1 B A 0 1 0 3 3 1 3 0 > tab2=table(s[,c(1,3)]) > tab2 C A 1 0 6 1 3 The problem is I need to access frequency corresponding to (0,0). tab1[1] will give me the correct value while tab2[1] will not give the frequency which I expected. So, is there a possibility in the table command to have the order of ta...
2013 Apr 10
6
means in tables
Hi. I have 2 tables, with same dimensions (8000 x 5). Something like: tab1: V1 V2 V3 V4 V5 14.23 1.71 2.43 15.6 127 13.20 1.78 2.14 11.2 100 13.16 2.36 2.67 18.6 101 14.37 1.95 2.50 16.8 113 13.24 2.59 2.87 21.0 118 tab2: V1 V2 V3 V4 V5 1.23 1.1 2.3 1.6 17 1.20 1.8 2.4 1.2 10 1.16 2.6 2.7 1.6 11 1.37 1.5 2.0 1.8 13 1.24 2.9 2.7 2.0 18 I need generate a table of averages, the elements in the same position in both tables, like: tab3: (14.23 + 1.23)/2 (1.71+1.1)/2 (127+17)/2 and so on I tried the progra...
2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
2011 Oct 29
1
Refresh tab content on click in JQuery UI Tabs
HI Guy''s TAB1 and TAB2 have some radio button, checkbox and dropdown menu. When TAB1 is selected, I have to switch to TAB2 and then back to TAB1 to refresh the loaded content. How to make TAB1 refresh loaded content when click on its tab? *code is something like that* <ul class="tabs"> <li&g...
2009 Dec 22
2
Nested For loops
...e) {     data<-read.table(infile)     data_value <- data[,-1]     data_value_mean <- mean(data_value)     data_value_square <- (data_value - data_value_mean) ^ 2     square_sum<-sum(data_value_square)     entry<-NROW(data_value)     deno<-square_sum/entry     tab1<-c()     tab2<-c()     ps_value <- seq(0,(floor(entry/2)),1)         for(k in 0:(floor(entry/2))){         for (i in 1:(entry-k)) {             mult<-(data_value[i] - data_value_mean) * (data_value [i+k] - data_value_mean)             tab1 <- c(tab1,mult)         }             auto_avg<-mean(tab1...
2011 Sep 08
1
ggplot2 freqpoly() layers..?
...) + geom_freqpoly(aes(x = value,                     y = ..density.., colour = X2))     ###### Plot 2- normal distributions with mean = 1     tab <- matrix(rnorm(10000,mean=1),1000,10)     colnames(tab) <- paste('b',1:ncol(tab),sep='')     rownames(tab) <- 1:nrow(tab)     tab2 <- melt(tab)         ggplot(tab2) + geom_freqpoly(aes(x = value,                     y = ..density.., colour = X2))         ###### Combined plot     comb <- cbind(mat,tab)     comb2 <- melt(comb)     cols <- c(rep('red',ncol(mat)*nrow(mat)),rep('black',ncol(tab)*nro...
2011 Oct 30
1
Normality tests on groups of rows in a data frame, grouped based on content in other columns
...a-for-loop. I think might be used for the printing of the results, but I do not know how to adjust for my data frame, since the functions are applied on several columns instead of certain rows in one column. DF <- data.frame(A = rnorm(100), B = rlnorm(100)) obj2 <- lapply(DF, shapiro.test) tab2 <- lapply(obj, function(x) c(W = unname(x$statistic), p.value = x$p.value)) tab2 <- data.frame(do.call(rbind, tab2)) printCoefmat(tab2, has.Pvalue = TRUE) Finally, I have found several different functions for testing for normality, but which one(s) should I choose? As far as I can see in the...
2013 Jan 08
0
bagging SVM Ensemble
...ewdata=testset, decision.values=F) prediction2<- predict(modelopoly,newdata=testset, decision.values=F) prediction3<- predict(modelorad,newdata=testset, decision.values=F) prediction4<- predict(modelotan,newdata=testset, decision.values=F) tab1 <- table(pred = prediction1,testset$class) tab2 <- table(pred = prediction2,testset$class) tab3 <- table(pred = prediction3,testset$class) tab4 <- table(pred = prediction4,testset$class) ecr1<-(tab1[2,1]+tab1[1,2])/sum(tab1) ecr2<-(tab2[2,1]+tab2[1,2])/sum(tab2) ecr3<-(tab3[2,1]+tab3[1,2])/sum(tab3) ecr4<-(tab4[2,1]+tab4[1,2...
2011 Sep 08
2
ggplot geom_freqpoly() layers ..?
...(mat2) + geom_freqpoly(aes(x = value, y = ..density.., colour = X2)) ###### Plot 2- normal distributions with mean = 1 tab <- matrix(rnorm(10000,mean=1),1000,10) colnames(tab) <- paste('b',1:ncol(tab),sep='') rownames(tab) <- 1:nrow(tab) tab2 <- melt(tab) ggplot(tab2) + geom_freqpoly(aes(x = value, y = ..density.., colour = X2)) ###### Combined plot comb <- cbind(mat,tab) comb2 <- melt(comb) cols <- c(rep('red',ncol(mat)*nrow(mat)),rep('black',ncol(tab)*nrow(tab)))...
2010 Jun 10
1
do faster ANOVAS
...e a matrice like that for ssprod, ssujet,sserreur,ssinter and sstotal. And this is for one permutation, and I want to do 1000 permutations Here is my code: SSmatrixglobal<-function(k){ daten.temp<-data daten.temp$product=permutations[[k]] listmat<-apply(daten.temp[,5:105],2,function(x,y){ tab2<-as.data.frame(cbind(x,y)) tab.class<-by(tab2[,1:3],tab2[,4],function(x){ f <- formula(paste(names(x)[1],"~",names(x)[2],"*",names(x)[3],sep="")) anovas <- aov(f, data=x) anovas$call$formula <-f s1 <- summary(anovas) qa <- s1[[1]][,2] return(qa) })...
2005 Jun 24
1
comparing strength of association instead of strength of evidence?
...ds ratios that describe the STRENGTH OF ASSOCIATION". Can I do this "decomposition" in R for the following example including 2 contingency tables? > tab1<-array(c(11266, 125, 2151526, 31734), dim=c(2,2)) > tab1 [,1] [,2] [1,] 11266 2151526 [2,] 125 31734 > tab2<-array(c(43571, 52, 2119221, 31807), dim=c(2,2)) > tab2 [,1] [,2] [1,] 43571 2119221 [2,] 52 31807 BTW, is there some good forum on the theory of statistics? r-help is a good one but I don't want to bother people by asking some questions weakly associated with R here. Tha...
2011 Nov 26
1
data.table merge equivalent for all.x
Een ingesloten tekst met niet-gespecificeerde tekenset is gescrubt ... Naam: niet beschikbaar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111126/e14d6638/attachment.pl>
2011 Oct 06
1
Wilcox Test / Mann Whitney U Test
...t's not what is causing the problem, as I can get the same W value. Am I calculating the test statistic incorrectly? Thanks, sample code below Sam Stewart #Ordinal example dropouts = c(rep(0,25),rep(3,10),rep(2,9),rep(1,13),rep(4,6)) remain = c(rep(0,31),rep(3,2),rep(2,6),rep(1,21),rep(4,3)) tab2 = rbind(table(dropouts),table(remain)) ordTest = wilcox.test(x=dropouts,y=remain,correct=FALSE,exact=FALSE) cumsum(colSums(tab2)) W = max(c(sum(rank(cbind(dropouts,remain))[1:length(dropouts)]),sum(rank(cbind(dropouts,remain))[-(1:length(dropouts))]))) n1 = length(dropouts) n2 = length(remain) test...
2009 Aug 06
1
calasification table under conditions
hi, i have a file with 49000 lines i want to do a classification in two tables suppose data <- read.csv2("c:/total.csv", sep=",") if the second colonne contains ( A,B,C,D)------------> tab1 if the second colonne contains ( E,F,G,H)------------> tab2 How can do this ? Thank you for your help [[alternative HTML version deleted]]
2005 Nov 15
1
latex table and R codes
Dear R-help assistance; may you help me regrding to following inquiry!? you know what, i have generated three tables by xtable R function, right now i am trying to make a single table by putting these tables togethere; actully i am going to come upt with *.tex (latex) file. because i have more extera non-R material, i am using Sweave to read R instructions, and finally i hope to end up with a
2005 Oct 25
2
data.frame-question
...the manuals, but I still have the following problem: I have 2 data-frames: Number<-as.numeric (Number) Name<-as.character (Name) TAB1<-data.frame (Name,Number) - it looks like this:- Name Number A 2 A 3 A 6 B 8 B 12 B 7 C 8 D 90 E 12 E 45 佲仸 Name_singular<-as.character (Name_singular) TAB2<-data.frame (Name_singular) # it looks like this: Name_singular A B C D E -My result should be a data-frame, where the first column is Name_singular and the second column should be the sum of the numbers where Name ==Name_singular.- For example: TAB3: Name_singular Sum A 11 B 27 佲仸 - I tried i...
2003 Aug 27
4
read.spss (package foreign) and character columns
Dear R users! I am using R Version 1.7.1, Windows XP, package "foreign" (Version: 0.6-1), SPSS 11.5.1. There is one thing I noticed with "read.spss", and I'd like to ask if this is considered to be a feature, or possibly a bug: When reading character columns, character strings seem to get filled with blanks at the end. Simple example: In SPSS, create a file with one
2007 Jan 27
5
Prototype not processing javascript
I''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered that either something is wrong with Prototype of else something has changed that I am not aware of and cannot find documentation on. (I just joined this group, so if this has already been cussed and discussed here or in another list then please point me in the right direction.) I am trying to use the