similar to: sum

Displaying 20 results from an estimated 6000 matches similar to: "sum"

2003 Oct 31
2
Summing elements in a list
Hi, Suppose that I have a list where each component is a list of two matrices. I also have a vector of weights. How can I collapse my list of lists into a single list of two matrices where each matrix in the result is the weighted sum of the corresponding matrices. I could use a loop but this is a nested calculation so I was hoping there is a more efficient way to do this. To help clarify,
2011 Mar 15
4
Element by element mean of a list of matrices
Hi All, is there any effiective and dense/compact method to calculate the mean of a list of - of course coincident - matrices on an element by element basis? The resulting matrix' [i, j]-th element is the mean of the list's matrices' [i, j]-th elements respectively... Iterating by for statement is quite straightforward, but I am seeking for a more elegant solution, and my attempt with
2002 Nov 27
6
Rbind help needed
Dear list I have a very simple question which is causing me problems! I have a matrix A and simply want to rbind this matrix together n times (n is a large number) How can I write this in R? I know I could do new<-rbind(z,z,z,...z) with z written n times but this will take forever as n is so large. Is there a simple way to write this? Cheers Mick
2010 Oct 07
2
Counting unique items in a list of matrices
Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help. -- Thanks, Jim. [[alternative HTML version deleted]]
2007 Nov 26
3
Fwd: Empty list to use in a for cycle
? 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/20071126/35b0349a/attachment.pl
2004 Aug 11
2
type III sum of squares
R-help What are the strengths and weakness of 'aov' in 'car' package? My model looks something like this : library(car) aov(lm(fish.length~zone*area,data=my.data)) Thank you Luis Ridao Cruz Fiskiranns??knarstovan N??at??n 1 P.O. Box 3051 FR-110 T??rshavn Faroe Islands Phone: +298 353900 Phone(direct): +298 353912 Mobile: +298 580800 Fax:
2010 Jan 17
4
datasets para regresión logística binomial y multinomial
Buenas. Sé que en R hay multitud de datasets y me haría falta alguno que trataran de variables relacionadas con salud, sobre todo para aprender más acerca de cómo realizar una regresión logística binomial o multinomial. Gracias..
2011 Oct 17
0
[Reading mat files into R]
Dear R users, I work with Matlab & R simultaneously. Usually I used to read successfully mat files (cell, structure, etc.) into R, till Matlab 2011b release. For reading mat files (or maybe I should say, converting it into R variable or structure) I’m using *readMat* (from “R.matlab” package). Even saving mat files in one of the previous formats (which can bet set in preference panel)
2009 Jul 16
2
evaluate sum of sum
Hi R-users, Could anybody show me how to write a code to evaluate sum(z[i] + sum(k[j]*(z[i])^(k[j])), i=1 to 4, j=0 to infinity) ? Thank you so much for any help given. [[alternative HTML version deleted]]
2003 Mar 07
1
Type IV sum of squares
To anyone who can help: I am trying to do an analysis of variance with a very unbalanced design and a few empty cells. How do I get R to use type III and more importantly type IV sums of squares? Thanks Deven Hamilton Department of Sociology University of Washington
2009 Nov 16
3
Sum over indexed value
I am sure this is easy but I am not finding a function to do this. I have two columns in a matrix. The first column contains multiple entries of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column contains unique numbers. I want to sum the numbers in column two based on the indexed values in column one (e.g. sum of all values in column two associated with the value 1 in column
2007 Oct 11
2
Type III sum of squares and appropriate contrasts
I am running a two-way anova with Type III sums of squares and would like to be able to understand what the different SS mean when I use different contrasts, e.g. treatment contrasts vs helmert contrasts. I have read John Fox's "An R and S-Plus Companion to Applied Regression" approach -p. 140- suggesting that treatment contrasts do not usually result in meaningful results with Type
2008 Jan 07
1
Rank sum in friedman test
Dear all, I'm using friedman rank test in R. Need to know how to calculate rank sum in friedman test (R options to get rank sum in friedman test). Kindly help me. With regards jeevitesh
2011 Feb 03
2
how to read the "Sum Sq" - column from summary.aov()
Dear R-Users, I have a trivial problem, but extensive googling and ??'ing did not solve it: I want to obtain the sums of squares from a summary.aov() object for later use. Example: > DV <- rnorm(100) > IV1 <- as.factor(rep(c("male", "female"), times = 50)) > IV2 <- as.factor(rep(c("young", "old"), times = 50)) > >
2006 Mar 27
2
apply(ing) to sum subset of a vector
Dear R users I am trying to sum selective elements of a vector but my solution is not cutting it. Example: > g <- 1:5; > from <- 1:3; > to <- 3:5; from to 1 3 2 4 3 5 so I expect 3 sums from g 1+2+3 that is 1 to 3 of g 2+3+4 that is 2 to 4 of g 3+4+5 that is 3 to 5 of g my solution will not work. sum.em <- function(g, c1, c2)
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling sums". (I have seen the Rmetrics package and the rollMean function and I would like to do the same thing except Sum instead of Mean.) I imagine someone has done this, I just can't find it anywhere. Example: x <- somevector #where x is 'n' entries long #what I would like to do is: x1
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
Greetings. For R gurus this may be a no brainer, but I could not find pointers to efficient computation of this beast in past help files. Background - I wish to implement a Cramer-von Mises type test statistic which involves double sums of max(X_i,Y_j) where X and Y are vectors of differing length. I am currently using ifelse pointwise in a vector, but have a nagging suspicion that there is a
2011 Oct 24
2
How to selectively sum rows [Beginner question]
Hi, I am new to R so I would appreciate any help. I have some data that has passenger flight data between city pairs. The way I got the data, there are multiple rows of data for each city pair; the number of passengers needs to be summed to get a TOTAL annual passenger count for each city pair. So my question is: how do I create a new table (or data frame) that selectively sums My initial
2003 Mar 06
6
type III Sum Sq in ANOVA table - Howto?
Hello, as far as I see, R reports type I sums of squares. I'd like to get R to print out type III sums of squares. e.g. I have the following model: vardep~factor1*factor2 to get the type III sum of squares for factor1 I've tried anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2)) but that didn't yield the desired result. Could anyone give me a hint how to proceed?
2012 Jan 10
4
Sum of a couple of variables of which a few have NA values
Dear everyone, I have looked all over the internet but I cannot find a way to solve my problem. In my data I want to sum a couple of variables. Some of these variables have NA values, and when I add them together, the result is NA dat <- data.frame( id = gl(5,1), var1 = rnorm(5, 10), var2 = rnorm(5, 7), var3 = rnorm(5, 6), var4 = rnorm(5, 3), var5 = rnorm(5, 8) ) dat[3,3] <- NA dat[4,5]