When the population values are not distributed symmetrically about the mean,
reporting the mean and standard deviation can give the reader an inaccurate
impression of the distribution of values in the population.
I'd like generating random samples with same mean and standard deviation, but
not
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of ???
> Sent: Tuesday, December 18, 2012 9:08 PM
> To: r-help@r-project.org
> Subject: [R] random sampling matrix
>
> Hello
>
>
>
> I have
Hello
I have a one question about random sampling matrix
I want to regeneration value of matrix
For example,
Matrix A :
1 2 3
11 12 13
21 22 23 .
> sample= data.frame(a[sample(1:dim(a)[1]),sample(1:dim(a)[2])])
Then,
Matrix sample :
21 23 22
11 13 12
1 3 2
But, I want
On Dec 18, 2012, at 9:07 AM, Kairos2012 wrote:
> Hi,
>
> help is very much appreciated. Thanks in advance!!!
>
> rgamma(...)
> As far as I know with this function (code) one can randomly sample 100
> numbers simultanously.
>
> Question is: is it possible to sample 100 random numbers e.g. fro
Hi,
help is very much appreciated. Thanks in advance!!!
rgamma(...)
As far as I know with this function (code) one can randomly sample 100
numbers simultanously.
Question is: is it possible to sample 100 random numbers e.g. from 100
different gamma distributions using only one command line (or:
see:
?boot
SASandRlearn wrote
> I have a large dataset from which i need to take a random sample many
> times ( say N=50) and run it through the same glm() - logistic regression
> model everytime ( 50 times ) and capture the chi-square p-values ( Pr >
> ChiSq ) of the variables for each run an
I have a large dataset from which i need to take a random sample many times (
say N=50) and run it through the same glm() - logistic regression model
everytime ( 50 times ) and capture the chi-square p-values ( Pr > ChiSq )
of the variables for each run and output average p-value of the variables
; >>>
> >>> Duncan Murdoch
> >>>
> >>>
> >>> Thanks a again,
> >>>>
> >>>>
> >>>> Gian
> >>>>
> >>>> On 13 September 2012 12:26, anna freni sterrantino <
> annafr.
no
Department of Statistics
University of Bologna, Italy
via Belle Arti 41, 40124 BO.
--
*Da:* Gian Maria Niccolň Benucci
*A:* r-help@r-project.org
*Inviato:* GiovedÄ› 13 Settembre 2012 10:42
*Oggetto:* [R] random sampling inside a dataset
Hi all,
I am wondering if do
>>> Duncan Murdoch
>>>>
>>>>
>>>> Thanks a again,
>>>>>
>>>>> Gian
>>>>>
>>>>> On 13 September 2012 12:26, anna freni sterrantino >>>>
>>>>>> wrote:
>&
>>> Gian
>>>>
>>>> On 13 September 2012 12:26, anna freni sterrantino >>>
>>>>> wrote:
>>>>>
>>>>
>>>> Hello Gian,
>>>>
>>>>> sure sample function
>>>>> will do it for y
p@r-project.org
*Inviato:* Giovedì 13 Settembre 2012 10:42
*Oggetto:* [R] random sampling inside a dataset
Hi all,
I am wondering if do exist a function in R that allow me to sample or
choose randomly the rows (i.e., samples) inside a given matrix.
Thank you very much in advance.
Cheers,
--
G
>
> Anna Freni Sterrantino
> Department of Statistics
> University of Bologna, Italy
> via Belle Arti 41, 40124 BO.
> --
> *Da:* Gian Maria Niccolò Benucci
> *A:* r-help@r-project.org
> *Inviato:* Giovedì 13 Settembre 2012 10:42
> *Oggetto:* [R] ran
On 13-09-2012, at 10:42, Gian Maria Niccolò Benucci wrote:
> Hi all,
>
> I am wondering if do exist a function in R that allow me to sample or
> choose randomly the rows (i.e., samples) inside a given matrix.
Use sample.
Like this for example
A <- matrix(runif(8*4), nrow=8)
A
select.row <- sa
Hi all,
I am wondering if do exist a function in R that allow me to sample or
choose randomly the rows (i.e., samples) inside a given matrix.
Thank you very much in advance.
Cheers,
--
Gian
[[alternative HTML version deleted]]
__
R-help@r-pro
Hi there,
It seems you got no answer. Maybe providing a reproducible example
would help, as well as expressing your problem in more general terms.
I am not an expert in sampling, but I would suggest (as does the help
for sample) that you take a look at the sampling package, available on
CRAN, and t
Hi,
I wonder if someone can help me. I have built a gam model to predict the
presence of cold water corals and am now trying to evaluate my model by
splitting my dataset into training/test datasets.
In an ideal world I would use the sample() function to randomly select rows of
data for me so fo
Andreas,
Thanks alot. I combined below and other suggestions given on r-help and it
worked.
--- On Fri, 4/8/11, Andreas Borg wrote:
From: Andreas Borg
Subject: Re: [R] random sampling with levels and with replacement
To: tab...@yahoo.com
Cc: "R help"
Date: Friday, Apr
Thanks Daniel,
Its a long way but it will work.
--- On Fri, 4/8/11, Daniel Malter wrote:
From: Daniel Malter
Subject: Re: [R] random sampling with levels and with replacement
To: r-help@r-project.org
Date: Friday, April 8, 2011, 10:08 AM
If you want perfect equality, split the data
Hi,
I am not perfectly sure what you want to do, but here is what I would do
to maintain good/bad ratio in the sample (as Daniel posted, split the
data and sample from the groups):
df <- data.frame(V1 = 1:400, V2 = c(rep("good",360), rep("bad",40)))
isGood <- which(df$V2=="good")
isBad <- whi
If you want perfect equality, split the data in good and bad and sample from
the two samples individually.
On average, however, random sampling from the entire data will reproduce the
proportion of good and bad in the data.
hth,
Daniel
--
View this message in context:
http://r.789695.n4.nabbl
Dear all,
i have a dataset of about 400 records , with a variable that has two levels 40
bad and 360 good among other variables,how do i come up with10 random samples
that have the composition of as the main sample but maintaining the 40 bad 360
good with replacement, i recently discovered th
?Control and ?sample should get you started.
Best,
Ista
On Thu, Mar 10, 2011 at 8:53 AM, taby gathoni wrote:
> Dear all,
>
> Could someone assist me in random sampling steps/code in R? I have a main
> sample of 42 males and 165 females and I want to come up with about 1000
> samples of 20 ma
Hello, Taby,
for your (first) problem take a look at
?sample
and its argument replace.
Regards -- Gerrit
On Thu, 10 Mar 2011, taby gathoni wrote:
Please note is with replacement
From: taby gathoni
To: R help
Sent: Thursday, March 10, 2011 11:53 AM
Subject: [R] random sampling steps
Dear all,
Could someone assist me in random sampling steps/code in R? I have a main
sample of 42 males and 165 females and I want to come up with about 1000
samples of 20 males and 20 females from this main sample. While at it, i would
also like to come up Accuracy Ratios (ARs) with correspo
> But if the 1st order differences are the same, then doesn't it follow that
> the 2nd, 3rd, ... order differences must be the same between the original and
> the new "random" vector. What am I missing?
You are missing nothing sorry, I wrote something wrong. What I would
like to be preserved is
> -Original Message-
> From: Emmanuel Levy [mailto:emmanuel.l...@gmail.com]
> Sent: Wednesday, August 12, 2009 4:48 PM
> To: Nordlund, Dan (DSHS/RDA)
> Cc: r-h...@stat.math.ethz.ch; dev djomson
> Subject: Re: [R] Random sampling while keeping distribution of nearest
>
sday, August 12, 2009 3:05 PM
>> To: r-h...@stat.math.ethz.ch
>> Cc: dev djomson
>> Subject: [R] Random sampling while keeping distribution of nearest neighbor
>> distances constant.
>>
>> Dear All,
>>
>> I cannot find a solution to the following probl
Thanks for your suggestion Ted,
This would indeed work for the particular example I gave, but I am
looking for a general solution.
For example, if my values are: V=c(2,4,5,6)
Then there would be two possibilities: 2,4,5,6 or 4,5,6,8
more generally, what I mean is that the matrix of distances betw
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Emmanuel Levy
> Sent: Wednesday, August 12, 2009 3:05 PM
> To: r-h...@stat.math.ethz.ch
> Cc: dev djomson
> Subject: [R] Random sampling while keeping di
Dear All,(my apologies if it got posted twice, it seems it didn't
get through)
I cannot find a solution to the following problem although I suppose
this is a classic.
I have a vector V of X=length(V) values comprised between 1 and N.
I would like to get random samples of X values also compri
On 12-Aug-09 22:05:24, Emmanuel Levy wrote:
> Dear All,
> I cannot find a solution to the following problem although I imagine
> that it is a classic, hence my email.
>
> I have a vector V of X values comprised between 1 and N.
>
> I would like to get random samples of X values also comprised bet
Dear All,
I cannot find a solution to the following problem although I imagine
that it is a classic, hence my email.
I have a vector V of X values comprised between 1 and N.
I would like to get random samples of X values also comprised between
1 and N, but the important point is:
* I would like
Joanne,
[...snip...]
x <- sample(1:2, 100) #without replacement
Now I want x to contain to 20% missing data (NA). Could anyone help me
how to do this?
See if this helps:
n <- length(x)
x[sample(n, 0.2*n)] <- NA
cheers,
-Girish
--
View this messag
If you want to average 20% missing values then you could try it in 1 step,
viz:
sample(c(1:2, rep(NA, 2000)),100)
Otherwise, 2 steps is preferable. Use code as below:
sample(1:2,100)->kk
kk[sample(1:100,20)]<-NA
Paul
--
View this message in context:
http://www.nabble.com/ran
Dear R users,
I'm trying to randomly recreate a real dataset with missing data and I'm
not quite sure if I can use the sample command for this. I think it
might be better to do it in 2 steps and randomly replace the sampled
data with missing data...
So something like this
x <- sample(1:
Thank you Adrian. Its working.Thank you so much. Take care =^D=)
Cheers
Arup Pramanik
Business Analyst
Redwood Associates
Bangalore,India.
Adrian Dusa wrote:
>
> On Tuesday 24 March 2009, you wrote:
>> Hello!I am having a problem with Random sampling in R. I have used a
>> syntax: mydata.sub
Arup wrote:
Hello!I am having a problem with Random sampling in R. I have used a syntax:
mydata.sub=sample(mydata,7,replace=FALSE,prob=NULL) which allows me to
choose a random sample based on the variables(correct me if I am wrong!).
Suppose I have 10 variable and if I use the above mentioned c
On Tuesday 24 March 2009, you wrote:
> Hello!I am having a problem with Random sampling in R. I have used a
> syntax: mydata.sub=sample(mydata,7,replace=FALSE,prob=NULL) which allows me
> to choose a random sample based on the variables(correct me if I am
> wrong!).
Actually, no.
You are sampling
Hello!I am having a problem with Random sampling in R. I have used a syntax:
mydata.sub=sample(mydata,7,replace=FALSE,prob=NULL) which allows me to
choose a random sample based on the variables(correct me if I am wrong!).
Suppose I have 10 variable and if I use the above mentioned command then it
40 matches
Mail list logo