search for: zhaox

Displaying 9 results from an estimated 9 matches for "zhaox".

Did you mean: zhao
2013 Apr 06
2
How to plot several years data with date information by months?
...meaning 12*6=72 bars or points in the figure. I though of a method, 1st, using the months function, then ploting. But I need to assign zero to the months without case. And a lot of other manipulations. Is there any simpler way to complete this? or just a simple function exists? Thanks in advance ZhaoXing
2011 Feb 11
3
How can we make a vector call a function element-wise efficiently?
...ta(vec[i])) user system elapsed 27.74 0.14 28.94 I have about 300,000 such 26.70/ 28.94 seconds, so the approximate computation time is 100 days What a terrible thing to do!!! Any modification, nomatter how subtle, will be a big help for me Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ?????????????????????????????
2011 Jan 03
3
matrices call a function element-wise
...ent of the 4 matrices. Using the "for loop" as follow: E<-o for (i in 1:1000) {for (j in 1:1000) { E<-fisher.test(matrix(c(A[i][j],B[i][j],C[i][j],D[i][j]),2))#call fisher.test for every element } } It is so time-consuming Need vectorization Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China [[alternative HTML version deleted]] __________________________________________________ 8O?lW"2aQE;"3,4sH]A?Cb7QSJOd?
2011 Jan 11
1
how to use "apply" function partial to each vector of a matrix
...end a for loop for (i in 1:4) { outsum=sum[1:end[i],i] } but when I want to do it to a large dataset, it's inefficency becomes a problem, so need vectorization the "apply" function will sum all of each vector, which is not my purpose Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ?????????????????????????????
2011 Jan 11
1
how to coerce part of each column of a matrix to a vector and merge them
...1:16,4) end<-c(2,3,1,3) vec<-numeric() for (i in 1:4) {vec<-c(vec,mat[1:end[i],i]) } #the result > vec [1] 1 2 5 6 7 9 13 14 15 but when I want to do it to a large dataset, it's inefficiency becomes a problem, so need vectorization Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ???????????????
2011 Feb 07
1
how to return multipy matrix in a function
...$ operator is invalid for atomic vectors > returnfunction(mat)$index Error in returnfunction(mat)$index : $ operator is invalid for atomic vectors the "returnfunction(mat)$value" should be 4,5,10 the "returnfunction(mat)$index" should be 3,1,2 Thank you in advance ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ????????????????????????????? ---------------------------------------------------------...
2011 Jan 07
4
how to calculate this natural logarithm
...hoose(1000000,600-i)+...+choose(2000000,600)*choose(1000000,0) #calculate the sum result=log(com_sum) #calculate the log of the sum } But every element of the com_sum is Inf, so I can't get the result Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ?????????????????????????????
2011 Feb 12
1
how to improve the precison of this calculation?
...of mailing-list, I hope if someone with stronge algebraical skills could give me some surprise 2.Through skills of R, which is difficult for me PS: I don't want a perfect solution but a better one, which could have a higher discriminability than before Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ?????????????????????????????
2011 Jan 10
0
how to create and manage a matrix with vector of different length
...d any material to learn. 1.Can anyone teach me how to creat and manage a matrix with vector of different length? 2.Can anyone teach me 2 or 3 matrices call a function element wise by vectorization? e.g. for (i in 1:10) A[i]^B[i]/C[i] Thank you in advance Yours sincerely ZhaoXing Department of Health Statistics West China School of Public Health Sichuan University No.17 Section 3, South Renmin Road Chengdu, Sichuan 610041 P.R.China __________________________________________________ ?????????????????????????????