[R] Question: How Kolmogorov Test is computed by R function ks.test, using scaled difference or unscaled

2014-03-07 Thread chee chen
Dear All,   I would like to ask for your help on the following when testing uniformity by the KS test:   1.  We know that the Kolmogorov test is based on the supremum D of the difference between the empirical distribution and the uniform distribution 2.  We also know that sqrt(n)D has a limiting

[R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Chee Chen
Dear All, I would like to ask for your help on reproducibility of random sampling with replacement. For example, one re-samples the rows with replacement of a residual matrix and uses the new residual matrix thus obtained to produce a statistic ; repeat this for a certain number of times. My

[R] Help: concurrent R sessions for different settings of simulations

2013-09-29 Thread Chee Chen
Dear All, I have spent almost 2 days but did not succeed yet. Problem description: I have 3 parameters, p1, p2 and p3, for which p1 take 1 of 5 possible distributions (e.g., normal, laplace), p2 takes 1 of 3 possible distributions, and p3 takes 1 of 5 possible distribution. These 3 parameters

[R] Question: write an R script with help information available to the user

2013-02-02 Thread Chee Chen
Dear All, I would like to ask a question on how to incorporate into an R script help information for the user. I vaguely recall that I saw some instructions on an R manual, but am not able to figure them out. Hereunder is the basic setting: 1. I finished writing an R script, my_script.r, that

[R] Help: is there a R Package for L1-regression (not regression with L1-penalty)

2012-11-21 Thread Chee Chen
Dear All, Is there a R package for L1-regression (meaning, optimize the sum of absolute deviations, NOT TO BE UNDERSTOOD as regression with L1-penalty) ? Any information will be appreciated. Regards, Chee [[alternative HTML version deleted]] __

[R] Help on subgraphs in xyplot of lattice library

2012-03-10 Thread Chee Chen
Dear All, I would like to ask a question on how to do overlay plots in each subgraph of xyplot. 1. I did simulations for m=1000, 2500, 5000, 1, as the sample sizes. 2. for each sample size value m, 4 graphs are generated; each graph contains overlayed comparisons between 4 methods, 3. now

Re: [R] Help on subgraphs in xyplot of lattice library

2012-03-10 Thread Chee Chen
std; the 4th is an overlay plot for idx against diff_std1, idx against diff_std2, idx against diff_std3. I have looked at sample xyplot codes, but still did not know how to realize this. Thanks again! Chee From: R. Michael Weylandt Sent: Saturday, March 10, 2012 12:20 PM To: Chee Chen Cc

[R] Request for help on manipulation large data sets

2012-01-26 Thread Chee Chen
Dear All, I would like to ask for help on how to read different files automatically and do analysis using scripts. 1. Description of the data 1.1. there are 5 text files, each of which contains cleaned data for the same 100 SNPs. Observations (e.g., position on gnome, alelle type, ...) for

Re: [R] Help: read a proportion of high through-put data

2012-01-24 Thread Chee Chen
Hi, Michael, Got it, thank you so much! Chee From: R. Michael Weylandt Sent: Monday, January 23, 2012 11:33 PM To: r-help ; Chee Chen Subject: Re: [R] Help: read a proportion of high through-put data Ok, it seems to have worked on my machine as well, but for some levels you didn't mention

[R] Help: read a proportion of high through-put data

2012-01-23 Thread Chee Chen
Dear All, I have a text file, tab delimited, called sample.txt,as follows: ID_REF382GC_ScoreThetaRB_Allele_FreqLog_R_Ratio 23BB0.91015270.97349790.878895110 26AB0.60033230.43850732.0333640.48509790.01553433 I have

[R] Import a text file except its first row

2012-01-16 Thread Chee Chen
Dear All, I would like to know how to: How to import just not the first row of a huge space/tab delimited text file of sequencing data. Thanks and regards, Chee [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Request for Help: remove zero in fraction from tick labeling

2011-11-06 Thread Chee Chen
Dear All, I would like to know how to do the following: 1. suppose I have x values from the ordered from 0, 0.5, 1, and would like to label these three points on the x-axis. 2. However, R labels them as 0.0, 0.5, 1.0. But I wan5 them to be 0, .5, 1, since the former way uses limited space of a

[R] Request for Help: y-axis label overlapped by x-axis in subplots in big plot

2011-11-06 Thread Chee Chen
Dear All, I would like to seek for help on this issue: 1. I set par(mfrow=c(2,2)), hoping to plot 4 subgraphs in a whole graph 2. Each subgraph has its own x,y axes and each has x-axis label and y-axis label 3. moreover, subgraphs in the left column of the whole graph are all 3D, and have z

[R] Possible Error in generic function rzigp in ZIGP Package

2011-08-25 Thread Chee Chen
Dear All, I would like to report a possible mistake in the generic function rzigp in ZIGP package, and seek for help. Yesterday I tried the rzigp function, in this way: 1. generate poisson means from a pareto distribuion, 2. generate dispersion for each poisson from gamma distribution 3.

[R] Help: find the index of the minimum of entries

2011-08-24 Thread Chee Chen
Dear All, I would like to ask a question on how to find the index of the minimum of entries of a numeric vector, without using loops or user defined functions. Suppose we have a vector: a - c(3,1,2) then, min(a) = 1 and its index is 2. Target: how to get the index of this minimum? How to get

[R] Help: convert entry of a list into a matrix

2011-08-24 Thread Chee Chen
Dear All, As always, I appreciate all your help. I would like to know the easiest way to convert each of the homogeneous elements of a numeric list into a matrix. Each element of this list is also a list such that when displayed, looks like a 2-by-3 matrix , I would like to convert each of them

[R] Help: Sort components of a vector with indices tracked in R

2011-08-23 Thread Chee Chen
Dear All, I would like to know how to sort a vector of numeric values such that we know the original index of each ordered component. Say, we have c - c(1,4,3,2) csort - sort(c,descreasing=FALSE) With a few components of c, we can manually find out: csort[1] = 1 = c[1], ie, the original index of

[R] Help: extrac the first entry for each component of a list

2011-08-23 Thread Chee Chen
Dear All, I would like to know, beside writing a function and then apply it to a list, or using a for loop, whether there is a one-line command to do the following. Suppose we have a list, each of whose components are numeric: a - vector(list,3) a[[1]] -c(1,2) a[[2]] -c(3,4) a[[3]] - c(5,6)

[R] help: how to generate counts from generalized poisson distribution

2011-08-19 Thread Chee Chen
Dear All, Is there a simulator that can generate observations from a generalized poisson distribution? Thanks and regards, Chee [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Question on where samples are grouped in rmvnorm{mvtnorm}

2011-04-30 Thread Chee Chen
Dear All, For function: rmvnorm{mvtnorm} in (library mvtnorm, not splus2R), if I generate 2 bivariate normal samples as follows: rmvnorm(2,mean=rep(0,2),sigma=diag(2)) [,1] [,2] [1,] 2.0749459 1.4932752 [2,] -0.9886333 0.3832266 Where is the first sample, it is stored in the

Re: [R] How to define specially nested functions

2011-04-29 Thread Chee Chen
I will have to recode in Mathematica). Any of your further help is much appreciated! Best regards, -Chee From: Jerome Asselin Sent: Friday, April 29, 2011 12:25 AM To: Chee Chen Cc: R -Help Subject: Re: [R] How to define specially nested functions On Thu, 2011-04-28 at 23:08 -0400, Chee

[R] How to define specially nested functions

2011-04-28 Thread Chee Chen
Dear All, I would like to define a function: f(x,y,z) with three arguments x,y,z, such that: given values for x,y, f(x,y,z) is still a function of z and that I am still allowed to find the root in terms of z when x,y are given. For example: f(x,y,z) = x+y + (x^2-z), given x=1,y=3, f(1,3,z)=

[R] How to generate normal mixture random variables with given covariance function

2011-04-22 Thread Chee Chen
Dear All, Suppose Z_i, i=1,...,m are marginally identically distributed as a two normal mixture p0*N(0,1) + (1-p0) *N( miu_i, 1) where miu_i are identically distributed according to a mixture and I have generated Z_i one by one . Now suppose these m random variables are jointly m-dimensional

[R] How to get the tuning parameter lamda in storey's qvalue package

2011-04-19 Thread Chee Chen
Dear All, In Storey's estimator of the proportion of true nulls, the estimator depends on the tuning parameter lamda. Suppose now that an estimator of this proportion has been obtained by the qvalue package, what is the lamda that corresponds to the estimate? How to get this lamda? Thanks, -Chee

[R] Extract indices after comparing two vectors

2011-04-18 Thread Chee Chen
Dear All, I would like to ask a question about how to locate the indices after comparing two numeric vectors. Say, I have, A - c(1,2,3,4) and A - c(0,3,1,5) and we cmpare: idx - AB So: idx [1] FALSE TRUE FALSE TRUE Question 1: I would like to get a vector that stores the indices for

Re: [R] How to generate a correlation matrix with restrictions on its eigenvalues

2011-04-16 Thread Chee Chen
: Ravi Varadhan Sent: Friday, April 15, 2011 8:14 AM To: Chee Chen ; r-help@r-project.org Subject: RE: [R] How to generate a correlation matrix with restrictions on its eigenvalues Generate random numbers from a multinomial. ?rmultinom # The following will generate n multinomial vectors each

[R] How to generate a correlation matrix with restrictions on its eigenvalues

2011-04-15 Thread Chee Chen
Dear All, I would like to generate m positive real numbers c_i, I=1,...,m, such that (1) c_1 + c_2 + ... + c_m=m, (1) after being ordered into c_1 = c_2 = =c_m0, we have that c_m is of the same order of m^(-1/8), when m is sufficiently large. Thanks, -Chee [[alternative HTML