similar to: matrix of random variables from a matrix of means and matrix of sd

Displaying 20 results from an estimated 20000 matches similar to: "matrix of random variables from a matrix of means and matrix of sd"

2006 Mar 31
1
matching a given sd range
Dear R users given a numeric array (a sequence of reals), I am interested in finding the subsets of sequences (each with start and end index) which match a given sd range. I read the docs on match and which and the "see also" but could not come up with a way. I could loop with a stepping window over the sequence but that would be limited to a fixed size window, I guess I as well
2012 Jun 20
1
prcomp: where do sdev values come from?
In the manual page for prcomp(), it says that sdev is "the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix)." ?However, this is not what I'm finding. ?The values appear to be the standard deviations of a reprojection of
2013 Sep 02
3
Product of certain rows in a matrix
Hi, You could try: A<- matrix(unlist(read.table(text=" 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 ",sep="",header=FALSE)),ncol=3,byrow=FALSE,dimnames=NULL) library(matrixStats) ?res1<-t(sapply(split(as.data.frame(A),as.numeric(gl(nrow(A),2,6))),colProds)) ?res1 #? [,1] [,2] [,3] #1??? 4?? 10?? 18 #2?? 63?? 64?? 63 #3?? 18?? 10??? 4
2013 Aug 26
4
transform variables
Dear all! I have a data frame composed by 13 columns (year, and 12 months). I want to transform this data base in another like this year month values 1901 1 1901 2 1901 3 ..... 1901 12 1902 1 1902 2 .... 1902 12 Is there a possibility to succeed that in R? Thank you! best regards! CR -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str.
2012 May 20
1
question about sign test
Hi, I want to compute p value of sign test for sample size=15 from normal distr., sd=0.5, mean=1, alternative should be two sided. Is this code correct in this situation? binom.test(sum(rnorm(15,1,0.5)>0),15,p=0.5,alternative="two")$p.value Or should I use another code (function) e.g. rbinom? Thank you very much. kind regards, T. Bal [[alternative HTML version deleted]]
2004 Jun 01
1
swapping with data.frame
Hi there, I have some data which are convenient to enter as lists. For example: t1<-list(fname="animal1",testname="hyla",dspkr="left",res1=39.7,res2=15.0) t2<-list(fname="animal1",testname="bufo",dspkr="left",res1=14.4,res2=56.1)
2006 Aug 18
1
multivariate analysis by using lme
Dear R users, I have a data structure as follows: id two res1 res2 c1 c2 inter 1 -0.786093166 1 0 1 2 6 3 -0.308495749 1 0 0 1 2 5 -0.738033048 1 0 0 0 1 7 -0.52176252 1 0
2007 Jan 23
3
Matrix operations in a list
I have matrices stored within a list like something as follows: a <- list(matrix(rnorm(50), ncol=5), matrix(rnorm(50), ncol=5)) b <- list(matrix(rnorm(50), nrow=5), matrix(rnorm(50), nrow=5)) I don't recall how to perform matrix multiplication on each list element such that the result is a new list result <- list(a[[1]]%*%b[[1]], a[[2]]%*%b[[2]]) I think I'm close with
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example. I modified a little to fit my real data, I got an error massage. Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) : Group length is 0 but data length > 0 On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] < ml-node+s789695n4657196h87@n4.nabble.com> wrote: > Hi, > Try this: >
2012 Jan 04
1
function in R for my exercise
Hi R helpers! I have a question. I'm trying to create a function for an exercise. Here are the arguments I should include: x and y are numeric z is a name ("plus","minus","multiply","divide") and swap is logical. Here is what the function should do: When z="plus", then x+y is performed and so on for the other z names. It should give a NA
2013 Jun 10
4
Combining CSV data
Hello R community, I am trying to combine two CSV files that look like this: File A Row_ID_CR, Data1, Data2, Data3 1, aa, bb, cc 2, dd, ee, ff File B Row_ID_N, Src_Row_ID, DataN1 1a, 1, This is comment 1 2a, 1, This is comment 2 3a,
2003 Aug 21
4
anova(lme object)
Hi, I use lme to fit models like R> res1 <- lme(y~A+B, data=mydata, random=~1|subject) R> res2 <- lme(y~B+A, data=mydata, random=~1|subject) (only difference between these two models are the sequence in which the indep variables are written in formula) where y is continuous and A, B, and subject are factors. To get ANOVA table I used R> anova(res1) R> anova(res2) and found
2013 Sep 26
2
Sums based on values of other matrix
Dear all, I have a big problem: - I got two matrices, A and B - A shows identifies the value of B, however the values of B must be summed - For instance, 1 1 2 2 2 2 1 1 gives matrix a 3 4 2 1 1 1 2 2 gives matrix b Now the result for the value 1 would be 7 4 which are the rowsums of the values of matrix B given that matrix A has the value 1. How can I do this automatically? I
2000 Jul 05
1
Tukey.aov with split-plot designs
I am using R 1.1 with Redhat 6.2 and RW 1.001 with Win98 (the upkey doesn't work on my IBM either as has been previously reported by others). The function aov doesn't return either the residuals or the residual degrees of freedom for split-plot designs. If you use the following code from Baron and Li's "Notes on the use of R for psycology experiments and questionnaires"
2011 May 19
3
problem with optim()
Dear R-users, I would like to maximize the function g above which depends on 4 parameters (2 vectors, 1 real number, and 1 matrix) using optim() and BFGS method. Here is my code: # fonction to maximize g=function(x) { x1 = x[1:ncol(X)] x2 = x[(ncol(X)+1)] x3 = matrix(x[(ncol(X)+2):(ncol(X)+1+ncol(X)*ncol(Y))],nrow=ncol(X),ncol=ncol(Y)) x4 = x[(ncol(X)+1+ncol(X)*ncol(Y)+1):length(x)]
2007 Apr 27
2
Jarque-Bera and rnorm()
Folks, I'm a bit puzzled by the fact that if I generate 100,000 standard normal variates using rnorm() and perform the Jarque-Bera on the resulting vector, I get p-values that vary drastically from run to run. Is this expected? Surely the p-val should be close to 1 for each test? Are 100,000 variates sufficient for this test? Or is it that rnorm() is not a robust random number generator?
2008 Jul 02
5
multiplication question
folks, is there a clever way to compute the sum of the product of two vectors such that the common indices are not multiplied together? i.e. if i have vectors X, Y, how can i compute Sum (X[i] * Y[j]) i != j where i != j also, what if i wanted Sum (X[i] * Y[j] * R[i, j]) i != j where R is a matrix? thanks, murali
2012 Nov 08
5
map two names into one
Thanks. Yes. Your approach can identify: Glaxy ace S 5830 and S 5830 Glaxy ace But you can not identify using same program: Iphone 4S 16 G Iphone 4S 16G How should I solve both in same time. Kind regards,Tammy [[alternative HTML version deleted]]
2013 Feb 17
6
histogram
HI Elisa, You could use ?cut() vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45) label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2013 May 07
4
how to calculate the mean in a period of time?
Hi, Your question is still not clear. May be this helps: dat2<- read.table(text=" patient_id????? t???????? scores 1????????????????????? 0??????????????? 1.6 1????????????????????? 1??????????????? 2.6 1????????????????????? 2???????????????? 2.2 1????????????????????? 3???????????????? 1.8 2????????????????????? 0????????????????? 2.3 2?????????????????????? 2???????????????? 2.5