[R] To calculate sample size based on generalized wilcoxon test or Tarone-Ware test

2011-03-15 Thread Zhipeng Wang
Dear all, I am trying to calculate sample size for a clinical research, on the basis of generalized wilcoxon test or Tarone-Ware test. It seems SAS can do this job using it "POWER" procedure, but SAS is not available to me. I would be very grateful if you could let me know if any R package or oth

[R] Connect observed values by a smooth curve, is there any method to get coordinate value of arbitrary point on the curve?

2011-03-29 Thread Zhipeng Wang
Dear all, I have the problem as the title shows. It is time series of measurements. I want to estimate the value at time point when we have no actual measured value (Only in the time range, not for prediction in future time). Hope you could give me some suggestion or hint. Thank you so much. Wa

Re: [R] Connect observed values by a smooth curve, is there any method to get coordinate value of arbitrary point on the curve?

2011-04-01 Thread Zhipeng Wang
Dear Prof. Murdoch and Dr. Winsemius, Thank you very much for your suggestion. They were big help. One of my friends told me another approach by using "smooth.spline". Here is the code: x <- c(1,2,3,4,5,6) y <- c(1,4,9,16,25,36) sp <- smooth.spline(x,y) x <- seq(1, 6, length=100) pred <- predict(

[R] matching a string with multiple conditions using grep

2012-06-23 Thread Zhipeng Wang
Suppose I have a vector ["A_cont_1", "A_cont_12", "B_treat_8", "AB_cont_22", "cont_21_Aa"], I hope I can extract the strings which include 3 short strings, say "A", "cont" and "2", that is to say, "A_cont_12", "AB_cont_22" and "cont_21_Aa" will be extract, using a relatively short code (using gr

Re: [R] matching a string with multiple conditions using grep

2012-06-23 Thread Zhipeng Wang
ot;, "AB_cont_22", "cont_21_Aa") > vec2<-grep("(A){0,1}.*cont.*2",vec1) > > vec1[vec2] > [1] "A_cont_12" "AB_cont_22" "cont_21_Aa" > > > A.K. > > > > > - Original Message - > From: Zhipeng

[R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Zhipeng Wang
Hello all, When I wanted to use package "foreach", I got the Error. That is: > library(foreach) Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1 Error: package/namespace load failed for ‘foreach’ I am using R-2.14.2, 64 bit. Even I reinstalled R and package "foreach", t

Re: [R] Error in get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

2012-06-28 Thread Zhipeng Wang
t; > Regards > > > Le 12/06/28 16:27, Zhipeng Wang a écrit : > >> Hello all, >> When I wanted to use package "foreach", I got the Error. >> That is: >> >>> library(foreach) >>> >> Error in get(Info[i, 1], envir = env) : >>