[R] sample size for beta regression

2023-05-19 Thread greg holly
Hi all, Does anyone have experience estimating the sample size for beta regression? I have three treatment groups with 0.6, 0.5 and 0.3 mean of proportions. I tried use BetaPASS but failed, Regards, Greg [[alternative HTML version deleted]] __

Re: [R] Sample size Determination to Compare Three Independent Proportions

2021-08-11 Thread AbouEl-Makarim Aboueissa
Hi Marc: Thank you for your help in this matter. With thanks Abou On Tue, Aug 10, 2021, 9:28 AM Marc Schwartz wrote: > Hi, > > A search would suggest that there may not be an R function/package that > provides power/sample size calculations for the specific scenarios that > you are describi

Re: [R] Sample size Determination to Compare Three Independent Proportions

2021-08-10 Thread Marc Schwartz via R-help
Hi, A search would suggest that there may not be an R function/package that provides power/sample size calculations for the specific scenarios that you are describing. There may be something that I am missing, and there is also other dedicated software such as PASS (https://www.ncss.com/softw

Re: [R] Sample size Determination to Compare Three Independent Proportions

2021-08-10 Thread AbouEl-Makarim Aboueissa
Hi Marc: First, thank you very much for your help in this matter. Will perform an initial omnibus test of all three groups (e.g. 3 x 2 chi-square), possibly followed by all possible 2 x 2 pairwise comparisons (e.g. 1 versus 2, 1 versus 3, 2 versus 3), We can assume *either* the desired sample s

Re: [R] Sample size Determination to Compare Three Independent Proportions

2021-08-09 Thread Marc Schwartz via R-help
Hi, You are going to need to provide more information than what you have below and I may be mis-interpreting what you have provided. Presuming you are designing a prospective, three-group, randomized allocation study, there is typically an a priori specification of the ratios of the sample s

[R] Sample size Determination to Compare Three Independent Proportions

2021-08-09 Thread AbouEl-Makarim Aboueissa
Dear All: good morning *Re:* Sample Size Determination to Compare Three Independent Proportions *Situation:* Three Binary variables (Yes, No) Three independent populations with fixed sizes (*say:* N1 = 1500, N2 = 900, N3 = 1350). Power = 0.80 How to choose the sample sizes to compare th

Re: [R] Question about using R sample datasets

2021-05-02 Thread Jeff Newmiller
, since there are a variety of license. >> >> David Winsemius, MD, (IANAL) >> >> >> > On May 1, 2021, at 12:17 PM, Maja Analytics < >> maja.analytics.b...@gmail.com> wrote: >> > >> > Hello! >> > >> > I would like to make tu

Re: [R] Question about using R sample datasets

2021-05-02 Thread Maja Analytics
rote: > > > > Hello! > > > > I would like to make tutorials for non-data scientists in R on Medium and > > as LinkedIn articles. Could you tell me if I can use R sample datasets (I > > would note the acknowledgements on the end)

Re: [R] Question about using R sample datasets

2021-05-02 Thread David Winsemius
emius, MD, (IANAL) >> >> >> > On May 1, 2021, at 12:17 PM, Maja Analytics >> > wrote: >> > >> > Hello! >> > >> > I would like to make tutorials for non-data scientists in R on Medium and >> > as LinkedIn articles.

Re: [R] Question about using R sample datasets

2021-05-01 Thread David Winsemius
cientists in R on Medium and > as LinkedIn articles. Could you tell me if I can use R sample datasets (I > would note the acknowledgements on the end) for that? > > Thanks in advance, kind regards, > Maja > > [[alternative HTML version deleted]] > > _

[R] Question about using R sample datasets

2021-05-01 Thread Maja Analytics
Hello! I would like to make tutorials for non-data scientists in R on Medium and as LinkedIn articles. Could you tell me if I can use R sample datasets (I would note the acknowledgements on the end) for that? Thanks in advance, kind regards, Maja [[alternative HTML version deleted

[R] Sample Order

2019-11-01 Thread Vmlum
GoodDay, We have an urgent requirement as per attached samples & specifications. Kindly quote your price and inquiry at the earliest .Also confirm the Terms & Condition included, Delivery schedule for supply. Looking forward to your valuable confirmation. sincerely yours -- Thanks Ar

Re: [R] Sample size required to estimate population variance

2019-07-05 Thread Stephen Ellison
> Thanks for the suggestion but I'm not sure that it answers my original > question.I need to know how many samples I need to collect to collect in > order to estimate the sample size needed to achieve a specific margin of > error for confidence intervals for the population variance. I'm not sure

Re: [R] Sample size required to estimate population variance

2019-07-04 Thread Thomas Subia via R-help
Thanks for the suggestion but I'm not sure that it answers my original question.I need to know how many samples I need to collect to collect in order to estimate the sample size needed to achieve a specific margin of error for confidence intervals for the population variance. I'm not sure wheth

Re: [R] Sample size required to estimate population variance

2019-07-04 Thread John via R-help
On Tue, 2 Jul 2019 22:23:18 + (UTC) Thomas Subia via R-help wrote: > Colleagues, > Can anyone suggest a package or code which might help me calculate > the minimum sample size required to estimate the population variance? > I can do this in Minitab but I'd rather do this in R. Thomas Subia Y

Re: [R] Sample size required to estimate population variance

2019-07-03 Thread ruipbarradas
just 1 but it will be zero.Hope this helps,Rui Barradas Enviado a partir do meu smartphone Samsung Galaxy. Mensagem original De: Thomas Subia via R-help Data: 02/07/2019 23:23 (GMT+00:00) Para: r-help@r-project.org Assunto: [R] Sample size required to estimate populatio

Re: [R] Sample size required to estimate population variance

2019-07-03 Thread ruipbarradas
homas Subia via R-help Data: 02/07/2019 23:23 (GMT+00:00) Para: r-help@r-project.org Assunto: [R] Sample size required to estimate population variance Colleagues,Can anyone suggest a package or code which might help me calculate the minimum sample size required to estimate the population varianc

Re: [R] Sample size required to estimate population variance

2019-07-02 Thread Richard O'Keefe
Does this help? https://www.r-bloggers.com/computing-sample-size-for-variance-estimation/ On Wed, 3 Jul 2019 at 10:23, Thomas Subia via R-help wrote: > Colleagues, > Can anyone suggest a package or code which might help me calculate the > minimum sample size required to estimate the population v

[R] Sample size required to estimate population variance

2019-07-02 Thread Thomas Subia via R-help
Colleagues, Can anyone suggest a package or code which might help me calculate the minimum sample size required to estimate the population variance? I can do this in Minitab but I'd rather do this in R. Thomas Subia [[alternative HTML version deleted]] ___

Re: [R] Sample function and prob argument

2019-06-05 Thread Duncan Murdoch
t) or if the user defines himself the probabilities (even if they are equal). I found this post on stackoverflow which explains the reasons of this difference (answer by Matthew Lundberg): https://stackoverflow.com/questions/23316729/r-sample-probabilities-defaul t-is-equal-weight-why

[R] Sample function and prob argument

2019-06-05 Thread le Gleut, Ronan
they are equal). I found this post on stackoverflow which explains the reasons of this difference (answer by Matthew Lundberg): https://stackoverflow.com/questions/23316729/r-sample-probabilities-defaul t-is-equal-weight-why-does-specifying-equal-weigh I was wondering whether the sol

Re: [R] sample (randomly select) to get a number of successive days

2018-12-10 Thread Dagmar Cimiotti
Thank you so much Marc, that is exactly what I need. That will save me weeks of work and additionally I learned a lot. :-) Have a great day! Dagmar Hi, Given that your original data frame example is: myframe <- data.frame (Timestamp=c("24.09.2012 09:00:00", "24.09.2012 10:00:00","25.09.2012

Re: [R] sample (randomly select) to get a number of successive days

2018-12-10 Thread Marc Schwartz via R-help
Hi, Given that your original data frame example is: myframe <- data.frame (Timestamp=c("24.09.2012 09:00:00", "24.09.2012 10:00:00","25.09.2012 09:00:00", "25.09.2012 09:00:00","24.09.2012 09:00:00", "24.09.2012 10:00:00"), Event=c(50,60

Re: [R] sample (randomly select) to get a number of successive days

2018-12-09 Thread Dagmar Cimiotti
Hi Marc, Yes, you got it to the point! That is exactly what I want. But I do not know how to do that. I know how to randomly pick the first day but I do not know how to set a range of values which cover the 25 days starting from that random value. Best, Dagmar Hi, I am confused. As far as

Re: [R] sample (randomly select) to get a number of successive days

2018-12-07 Thread Marc Schwartz via R-help
Hi, I am confused. As far as I can tell, only the first day is selected randomly from your dataset. The subsequent 24 days are deterministic, since they need to be consecutive days from the first day, for a total of 25 consecutive days. Thus, all you need to do is to randomly select 1 day fro

[R] sample (randomly select) to get a number of successive days

2018-12-07 Thread Dagmar Cimiotti
Hi Jim and everyone else, Mhm, no this is not what I am looking for. I think in your way I would randomly sample two values of day 1 and of day 2. But I want the opposite: I want to randomly draw two successive (!) days and put those values in a new dataframe to continue working with them. In

Re: [R] sample (randomly select) from successive days

2018-12-07 Thread Jeff Newmiller
myfirst <- sample( seq.int( nrow(myframe)-1 ), 1 ) mysample <- myframe[seq( myfirst, myfirst+1),] mysample On December 7, 2018 2:24:11 AM PST, Dagmar Cimiotti wrote: >Hi Jim and everyone else, > >Mhm, no this is not what I am looking for. I think in your way I would >randomly sample two values

Re: [R] sample (randomly select) from successive days

2018-12-07 Thread Dagmar Cimiotti
Hi Jim and everyone else, Mhm, no this is not what I am looking for. I think in your way I would randomly sample two values of day 1 and of day 2. But I want the opposite: I want to randomly draw two successive (!) days and put those values in a new dataframe to continue working with them. I

Re: [R] sample (randomly select) from successive days

2018-12-07 Thread Jim Lemon
Hi Dagmar, This will probably involve creating a variable to differentiate the two days in each data.frame: myframe$day<-as.Date(as.character(myframe$Timestamp),"%d.%m.%Y %H:%M:%S") days<-unique(myframe$day) Then just sample the two subsets and concatenate them: myframe[c(sample(which(myframe$da

[R] sample (randomly select) from successive days

2018-12-07 Thread Dagmar Cimiotti
Dear all, I have data from a time span like this: myframe <- data.frame (Timestamp=c("24.09.2012 09:00:00", "24.09.2012 10:00:00","25.09.2012 09:00:00", "25.09.2012 09:00:00","24.09.2012 09:00:00", "24.09.2012 10:00:00"), Event=c(50,60

Re: [R] Sample of a subsample

2017-09-25 Thread Bert Gunter
Yes. Beating a pretty weary horse, a slightly cleaner version of my prior offering using with(), instead of within() is: with(dat, dat[sampleNo[sample(var1[!var1%%2 & !sampleNo], 10, rep=FALSE)], "sampleNo"] <- 2) with() and within() are convenient ways to avoid having to repeatedly name the col

Re: [R] Sample of a subsample

2017-09-25 Thread Eric Berger
Hi David, I was about to post a reply when Bert responded. His answer is good and his comment to use the name 'dat' rather than 'data' is instructive. I am providing my suggestion as well because I think it may address what was causing you some confusion (mainly to use "which", but also the missing

Re: [R] Sample of a subsample

2017-09-25 Thread Bert Gunter
For personal aesthetic reasons, I changed the name "data" to "dat". Your code, with a slight modification: set.seed (1357) ## for reproducibility dat <- data.frame(var1=seq(1:40), var2=seq(40,1)) dat$sampleNo <- 0 idx <- sample(seq(1,nrow(dat)), size=10, replace=F) dat[idx,"sampleNo"] <-1 ## yi

[R] Sample of a subsample

2017-09-25 Thread David Studer
Hello everybody! I have the following problem: I'd like to select a sample from a subsample in a dataset. Actually, I don't want to select it, but to create a new variable sampleNo that indicates to which sample (one or two) a case belongs to. Lets suppose I have a dataset containing 40 cases: d

Re: [R] Sample size calculation for three-way incomplete block crossover study.

2017-09-05 Thread Bert Gunter
Sounds like a homework problem. This list has a no homework policy if it is. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Sep 4, 2017 at 10:31

[R] Sample size calculation for three-way incomplete block crossover study.

2017-09-04 Thread Jomy Jose
Hi In R,how to do sample size calculation for three-way incomplete block crossover study where within subject residual standard deviation,treatment difference and power is given. Thanks in advance. Regards Jose [[alternative HTML version deleted]] __

Re: [R] Sample size using residual standard deviation

2017-04-12 Thread peter dalgaard
Or power.t.test() -pd > On 12 Apr 2017, at 18:44 , Bert Gunter wrote: > > Search "sample size power" on rseek.org. Many useful hits, including > "samplesize" package. > > -- Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking thin

Re: [R] Sample size using residual standard deviation

2017-04-12 Thread Bert Gunter
Search "sample size power" on rseek.org. Many useful hits, including "samplesize" package. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Apr 12

Re: [R] Sample size using residual standard deviation

2017-04-12 Thread David Winsemius
> On Apr 12, 2017, at 3:20 AM, Jomy Jose wrote: > > In R how to calculate sample size,where power,residual standard deviation > and treatment difference is given.? Use the non-central t-distribution. The help page has further advice: ?pt > > [[alternative HTML version deleted]] Pleas

[R] Sample size using residual standard deviation

2017-04-12 Thread Jomy Jose
In R how to calculate sample size,where power,residual standard deviation and treatment difference is given.? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] sample train and test data using dplyr

2016-12-09 Thread Jim Lemon
Sample without replacement and then split that sample into train and test components. Jim On Fri, Dec 9, 2016 at 4:55 PM, Partha Sinha wrote: > How to get two sets of non overlapping data? > Regards > Parth __ R-help@r-project.org mailing list -- To U

Re: [R] sample train and test data using dplyr

2016-12-08 Thread Ulrik Stervbo
df <- data.frame(x = 1:12, y = rnorm(12)) If you use sample: RowIndex <- sample(1:nrow(df), 5) TrainSet <- df[RowIndex, ] TestSet <- df[-RowIndex, ] Or with dplyr: TrainSet <- sample_n(df, 5) TestSet <- anti_join(TestSet, df) HTH Ulrik On Fri, 9 Dec 2016, 06:56 Partha Sinha, wrote: > How to

Re: [R] sample train and test data using dplyr

2016-12-08 Thread Partha Sinha
How to get two sets of non overlapping data? Regards Parth On 8 December 2016 at 23:23, Ulrik Stervbo wrote: > In addition to 'sample', and if you insist on dplyr, you can use > 'sample_n'. > > Best, > Ulrik > > On Thu, 8 Dec 2016 at 18:47 Bert Gunter wrote: > >> Usually we expect posters to do

Re: [R] sample train and test data using dplyr

2016-12-08 Thread Ulrik Stervbo
In addition to 'sample', and if you insist on dplyr, you can use 'sample_n'. Best, Ulrik On Thu, 8 Dec 2016 at 18:47 Bert Gunter wrote: > Usually we expect posters to do their homework by reading necessary R > documentation and relevant subject matter resources (e.g. on > clustering) and making

Re: [R] sample train and test data using dplyr

2016-12-08 Thread Bert Gunter
Usually we expect posters to do their homework by reading necessary R documentation and relevant subject matter resources (e.g. on clustering) and making a serious attempt to solve the problem by offering their code to us along as part of a reproducible example of how it failed. You have done none

[R] sample train and test data using dplyr

2016-12-08 Thread Partha Sinha
I want to create two files train and test using dplyr (by random sampling method). How to do the same same using lets say iris data. Regards Parth [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo

[R] Sample selection using multiple logit or similar

2016-05-27 Thread Andrew Perrin
Greetings- I am seeking to fit a model using Heckman-style selection; however the wrinkle is that the selection is into multiple categories, not a binary in/out. In this case, selection is into the type of higher-education institution a student attended; the goal is to estimate post-graduation

Re: [R] sample within a loop

2016-03-20 Thread DIGHE, NILESH [AG/2362]
lp@r-project.org Subject: Re: [R] sample within a loop Hi, you can try df1<-split(df,df$groups) lapply(df1, function(x) { x<-cbind(x,entry=0) sam <- sample(x$plotno,1) x$entry[which(x$plotno==sam)]<-"CONTROL" x$entry[which(!x$plotno==sam)]<-"TEST" x

[R] sample within a loop

2016-03-19 Thread DIGHE, NILESH [AG/2362]
Dear R users, My data frame has four "groups" namely A1, B2, C3, & D4. Each group has 12 rows (variable "plotno). I like to randomly sample one "plotno" within each "groups" variable and label it as "CONTROL" and label others as "TEST" in a new variable called "entry". I am tr

Re: [R] sample within a loop

2016-03-19 Thread Mohammad Tanvir Ahamed via R-help
org, Sweden | mashra...@yahoo.com From: "DIGHE, NILESH [AG/2362]" To: "r-help@r-project.org" Sent: Thursday, 17 March 2016, 18:18 Subject: [R] sample within a loop Dear R users, My data frame has four "groups" namely A1, B2,

Re: [R] sample within a loop

2016-03-19 Thread MacQueen, Don
I would change strategies. Create a new variable, say, num.in.grp <- rep(1:12, 4) Then sample from 1:12, and add appropriate amounts so that they become row numbers within the four sets of 12 rows ctrls <- ssample(1:12, 4, replace=TRUE) + c(0,12,24,36) Now that we have four random row number

Re: [R] Sample Weights

2015-07-27 Thread PIKAL Petr
Hi > wrote: > >Dear Sir, > > > >I do appreciate your views. Yes even I was also aware about the non > >clarity in the question. Actaully, I have a large data having lots of > >data of low magnitude and few of very high magnitude. In order to can you explain what is low or high magnitude? Or be

Re: [R] Sample Weights

2015-07-27 Thread Jeff Newmiller
R is a computing tool, and each package has implemented algorithms that have history and books and papers that allow those algorithms to be used in a variety if computing environments... from Fortran to Excel to Java to ... R, and probably beyond. >From your description I am going to hazard a g

Re: [R] Sample Weights

2015-07-26 Thread Jeff Newmiller
If you have a clear idea what meaning those weights have (?) in the context of a specific calculation (?), and you know what the weights are (?), then it is usually trivially easy to do in R. However, your question is vague on all of those points, so offering you a solution seems like an invita

[R] Sample Weights

2015-07-26 Thread Amelia Marsh via R-help
Dear R Forum I have a data.frame as mydat = c(6,6,5,6,4,6,8,4,6,6,6,3,4,6,5,7,7,4,3,5,5,5,3,6,7,4,4,7,4,3,4,6,4,6,5,4,4,7,6,8,5,6,5,5,8,2,3,5,7,5) Is there any library or way in R to allocate weights to these values? Actually I am having a large data, but for illustrative purpose, have consid

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread tahira jamil
gt; a b c d > [1,] 10 5 5 0 > [2,] 11 4 4 1 > [3,] 12 3 3 2 > [4,] 13 2 2 3 > [5,] 14 1 1 4 > [6,] 15 0 0 5 > > David C > > From: Michael Peng [mailto:michael.gang.p...@gmail.com] > Sent: Tuesday, June 24, 2014 1:32 PM > To: David L Carlson > Cc: Gabor Grot

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread David L Carlson
Sent: Tuesday, June 24, 2014 1:32 PM To: David L Carlson Cc: Gabor Grothendieck; Tahira Jamil; r-help@r-project.org Subject: Re: [R] Sample all possible contingency tables both margin fixed David gave a great solution. I think it is better to start from 0 to min(M) instead of from min(M[c(1,3)]) to

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread Michael Peng
-- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Gabor Grothendieck > Sent: Tuesday, June 24, 2014 12:07 PM > To: Tahira Jamil > Cc: r-help@r-project.org > Subject: Re: [R] Sample all possible contingency tables both margin fixed > &g

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread David L Carlson
Cc: r-help@r-project.org Subject: Re: [R] Sample all possible contingency tables both margin fixed On Tue, Jun 24, 2014 at 10:41 AM, Tahira Jamil wrote: > Hi, > > I am interested in generating all possible contingency table (2 by 2) with > fixed row margins and column margins. Can anyone

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread peter dalgaard
On 24 Jun 2014, at 16:41 , Tahira Jamil wrote: > Hi, > > I am interested in generating all possible contingency table (2 by 2) with > fixed row margins and column margins. Can anyone help me. > It's pretty easy, just find one compatible solution and add or subtract 1 -1 -1 1 until one o

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread Gabor Grothendieck
On Tue, Jun 24, 2014 at 10:41 AM, Tahira Jamil wrote: > Hi, > > I am interested in generating all possible contingency table (2 by 2) with > fixed row margins and column margins. Can anyone help me. > If the reason you want this is to sample them then r2dtable can do that directly.

[R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread Tahira Jamil
Hi, I am interested in generating all possible contingency table (2 by 2) with fixed row margins and column margins. Can anyone help me. Best regards, Tahira [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://s

[R] Sample size for clustering analysis?

2013-11-05 Thread Li, Yan
Hi All, What formula can I use to determine the right sample size for clustering analysis with 100-300 variables? What sampling methodology can be used for k-means or hierarchical clustering on categorical fields so that all values of the categorical fields are included in the sample? Thanks

Re: [R] sample size determination - comparing means for different size samples

2013-06-07 Thread Rui Barradas
Hello, At an R prompt, type ?power.t.test Hope this helps, Rui Barradas Em 06-06-2013 20:58, Rebecca Greenblatt escreveu: Looking to determine sample sizes for both my experimental and control groups (I want only a small portion of my participants in my experimental condition) in order to co

Re: [R] sample size determination - comparing means for different size samples

2013-06-06 Thread David Winsemius
This is a duplicate question, right? On Jun 6, 2013, at 12:58 PM, Rebecca Greenblatt wrote: > Looking to determine sample sizes for both my experimental and control > groups (I want only a small portion of my participants in my experimental > condition) in order to compare population means. I wou

[R] sample size determination - comparing means for different size samples

2013-06-06 Thread Rebecca Greenblatt
Looking to determine sample sizes for both my experimental and control groups (I want only a small portion of my participants in my experimental condition) in order to compare population means. I would be able to estimate standard deviation beforehand. I'm using the bpower function from the Hmisc

Re: [R] sample {base}

2013-06-05 Thread arun
ot;SpCode",5),4) #$`40_49.MERLMER` #[1]  34  38 143   3  19 # #$`50_59.MERLMER` #[1]  20 112 115 104  77 # #$`60_69.MERLMER` #[1] 130 136  40 128  32 # #$`70_.MERLMER` #[1] 44 63 96 A.K. - Original Message - From: Xochitl CORMON To: r-help@r-project.org Cc: Sent: Wednesday, Jun

Re: [R] sample {base}

2013-06-05 Thread Xochitl CORMON
Thank you Sarah for this code, it's exactly what I wanted to reach. Le 05/06/2013 16:49, Sarah Goslee a écrit : What about using instead size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]]& Gpool$SpCode == SpCode[[2]]]) that would make sure your sample is either the size of t

Re: [R] sample {base}

2013-06-05 Thread David Carlson
--- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Xochitl CORMON Sent: Wednesday, June 5, 2013 9

Re: [R] sample {base}

2013-06-05 Thread Sarah Goslee
What about using instead size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]] & Gpool$SpCode == SpCode[[2]]]) that would make sure your sample is either the size of the data or 5. Sarah On Wed, Jun 5, 2013 at 10:27 AM, Xochitl CORMON wrote: > Hi all, > > I'm trying to randomly se

[R] sample {base}

2013-06-05 Thread Xochitl CORMON
Hi all, I'm trying to randomly select sample numbers for length class groups (5 per length class). For this I'm using a loop FOR and the function sample () and specified a size for the sampling of 5. Unfortunately, one of the length class group does not contain 5 individuals. For me is not a

Re: [R] sample(c(0, 1)...) vs. rbinom

2013-05-23 Thread Albyn Jones
n Jones > > Sent: Thursday, May 23, 2013 8:30 AM > > To: r-help@r-project.org > > Subject: Re: [R] sample(c(0, 1)...) vs. rbinom > > > > After a bit of playing around, I discovered that > > sample() does something similar in other situations: > > &g

Re: [R] sample(c(0, 1)...) vs. rbinom

2013-05-23 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Albyn Jones > Sent: Thursday, May 23, 2013 8:30 AM > To: r-help@r-project.org > Subject: Re: [R] sample(c(0, 1)...) vs. rbinom > > After a bit of play

Re: [R] sample(c(0, 1)...) vs. rbinom

2013-05-23 Thread Albyn Jones
After a bit of playing around, I discovered that sample() does something similar in other situations: set.seed(105021) sample(1:5,1,prob=c(1,1,1,1,1)) [1] 3 set.seed(105021) sample(1:5,1) [1] 2 set.seed(105021) sample(1:5,5,prob=c(1,1,1,1,1)) [1] 3 4 2 1 5 set.seed(105021) sample(1:5,5)

Re: [R] sample(c(0, 1)...) vs. rbinom

2013-05-22 Thread peter dalgaard
On May 23, 2013, at 07:01 , Jeff Newmiller wrote: > You seem to be building an elaborate structure for testing the > reproducibility of the random number generator. I suspect that rbinom is > calling the random number generator a different number of times when you pass > prob=0.5 than otherwis

Re: [R] sample(c(0, 1)...) vs. rbinom

2013-05-22 Thread Jeff Newmiller
You seem to be building an elaborate structure for testing the reproducibility of the random number generator. I suspect that rbinom is calling the random number generator a different number of times when you pass prob=0.5 than otherwise. -

[R] sample(c(0, 1)...) vs. rbinom

2013-05-22 Thread Michael Hannon
Greetings.  My wife is teaching an introductory stat class at UC Davis.  The class emphasizes the use of simulations, rather than mathematics, to get insight into statistics, and R is the mandated tool.   A student in the class recently inquired about different approaches to sampling from a binomia

Re: [R] sample size in box plot labels

2013-04-26 Thread PIKAL Petr
.@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Shane Carey > Sent: Friday, April 26, 2013 1:09 PM > To: Rui Barradas > Cc: r-help@r-project.org > Subject: Re: [R] sample size in box plot labels > > This works, great. Cheers > > > On Fri, Apr 2

Re: [R] sample size in box plot labels

2013-04-26 Thread Shane Carey
This works, great. Cheers On Fri, Apr 26, 2013 at 12:02 PM, Rui Barradas wrote: > Hello, > > To count the sample sizes for each factor try > > tapply(DATA$K_Merge, DATA$UnitName_1, FUN = length) > > > Hope this helps, > > Rui Barradas > > Em 26-04-2013 10:48, Shane Carey escreveu: > > Hi, >> >

Re: [R] sample size in box plot labels

2013-04-26 Thread Rui Barradas
Hello, To count the sample sizes for each factor try tapply(DATA$K_Merge, DATA$UnitName_1, FUN = length) Hope this helps, Rui Barradas Em 26-04-2013 10:48, Shane Carey escreveu: Hi, I would like to put the sample number beside each lable in a boxplot. How do I do this? Essentially, I need

Re: [R] sample size in box plot labels

2013-04-26 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Shane Carey > Sent: Friday, April 26, 2013 11:49 AM > To: r-help@r-project.org > Subject: [R] sample size in box plot labels > > Hi, > >

[R] sample size in box plot labels

2013-04-26 Thread Shane Carey
Hi, I would like to put the sample number beside each lable in a boxplot. How do I do this? Essentially, I need to count the sample size for each factor, see below: Thanks boxplot(DATA$K_Merge~factor(DATA$UnitName_1),axes=FALSE,col=colours) title(main=list("Tukey Boxplot by Geology:\n K(%)",cex=c

Re: [R] sample mean, variance and SD

2012-11-10 Thread David Winsemius
On Nov 10, 2012, at 6:58 PM, Jim Lemon wrote: > On 11/11/2012 07:09 AM, Greg Snow wrote: >> This is to all R-helpers (Sarah is just the one that I am replying to), >> >> Have we become a little too draconian on the "not a homework help list" >> issue? >> ... > > As usual, a thoughtful comment o

Re: [R] sample mean, variance and SD

2012-11-10 Thread Jim Lemon
On 11/11/2012 07:09 AM, Greg Snow wrote: This is to all R-helpers (Sarah is just the one that I am replying to), Have we become a little too draconian on the "not a homework help list" issue? ... As usual, a thoughtful comment on a problem that does not have a straightforward solution. The ac

Re: [R] sample mean, variance and SD

2012-11-10 Thread Jeff Newmiller
It is not always easy to discern what the instructor wants a student to get out of an assignment. Therefore, I can't see changing the policy as it stands. That said, it is not always easy to discern homework from self-study, and sometimes when the question is well-constructed I don't go out of

Re: [R] sample mean, variance and SD

2012-11-10 Thread Sarah Goslee
I agree with much of what you said. If there is a reasonable effort to have read the documention or otherwise to have solved the problem on their own, and a clear question, I will frequently at least give a hint or a pointer toward a relevant function or two. Also, I wouldn't consider that the firs

Re: [R] sample mean, variance and SD

2012-11-10 Thread Berend Hasselman
On 10-11-2012, at 19:23, parvez_200207 wrote: > hi > could you help me to solve this issue > > Question: > Using command rweibull(100,8,15), simulate n = 100 realizations from > Weibull(8; 15) distribution. Using the simulated sample, compute the sample > mean, variance and standard deviation of

Re: [R] sample mean, variance and SD

2012-11-10 Thread Berend Hasselman
On 10-11-2012, at 21:09, Greg Snow wrote: > This is to all R-helpers (Sarah is just the one that I am replying to), > > Have we become a little too draconian on the "not a homework help list" > issue? Probably. > > Now if someone just states the HW question, gives no indication that they > ha

Re: [R] sample mean, variance and SD

2012-11-10 Thread Greg Snow
This is to all R-helpers (Sarah is just the one that I am replying to), Have we become a little too draconian on the "not a homework help list" issue? Now if someone just states the HW question, gives no indication that they have done anything to try to solve it themselves, and expects us to give

Re: [R] sample mean, variance and SD

2012-11-10 Thread Greg Snow
Your code works for me, can you tell us what output you are getting, what output you expect to see, and how they differ? On Sat, Nov 10, 2012 at 11:23 AM, parvez_200207 wrote: > hi > could you help me to solve this issue > > Question: > Using command rweibull(100,8,15), simulate n = 100 realiza

Re: [R] sample mean, variance and SD

2012-11-10 Thread Sarah Goslee
This is not a homework help list. On Saturday, November 10, 2012, parvez_200207 wrote: > hi > could you help me to solve this issue > > Question: > Using command rweibull(100,8,15), simulate n = 100 realizations from > Weibull(8; 15) distribution. Using the simulated sample, compute the sample >

[R] sample mean, variance and SD

2012-11-10 Thread parvez_200207
hi could you help me to solve this issue Question: Using command rweibull(100,8,15), simulate n = 100 realizations from Weibull(8; 15) distribution. Using the simulated sample, compute the sample mean, variance and standard deviation of these observations. I am trying like this sim<-rweibull(100

Re: [R] sample from list

2012-11-08 Thread Jean V Adams
an then simulate mutations by changing the > gene values, cause duplications by adding rows of duplicated genes, > or even cause deletions by removing rows. > Once I have this set up for the pathogen I may make a similar array > for the host plants, then perhaps with indexing or s

Re: [R] sample from list

2012-11-08 Thread Benjamin Ward (ENV)
indexing or some such thing I can write functions to do the interactions and immunology and such. Best, Ben W. UEA (ENV) & The Sainsbury Laboratory. ________ From: Jean V Adams [jvad...@usgs.gov] Sent: 07 November 2012 21:12 To: Benjamin Ward (ENV) Cc: r-help@r-projec

Re: [R] sample from list

2012-11-07 Thread Jean V Adams
Ben, Can you provide a small example data set for inds so that we can run the code you have supplied? It's difficult for me to follow what you've got and where you're trying to go. Jean "Benjamin Ward (ENV)" wrote on 11/06/2012 03:29:52 PM: > > Hi all, > > I have a list of genes p

[R] sample from list

2012-11-06 Thread Benjamin Ward (ENV)
Hi all, I have a list of genes present in 500 individuals, the individuals are the elements: Genes <- lapply(1:nrow(inds),function(x) sample(1:1,inds$No_of_Genes,replace=TRUE)) (This was later written to a dataframe as well as kept as the list object: inds2 <- data.frame(inds,Genes=I(Genes

Re: [R] sample equal number of cases per class

2012-11-04 Thread Rui Barradas
Hello, Function caret::createDatapartition preserves the proportions of classes, like its documentation says, so you should expected the result to be balanced only if the original data.frame is also balanced. A solution is to write a small function that chooses a balanced set of indices. Note

[R] sample equal number of cases per class

2012-11-04 Thread ollestrat
Dear community I have a dataframe and want to split it into a learn and a test partition. However the learnset should be balanced, i.e. each class should have the same number of cases. I tried and searched a lot, without success so far. Maybe you can help? Some example code *# generate example da

Re: [R] sample with equal probabilities

2012-10-06 Thread R. Michael Weylandt
Please don't double post. And see my response to you here: https://stat.ethz.ch/pipermail/r-help/2012-October/325470.html Michael On Sat, Oct 6, 2012 at 6:51 PM, solafah bh wrote: > Hello > If I have this vector x=c(5,1,2,9) and n=length(x) and I want to sample one > value from x , and each va

[R] sample with equal probabilities

2012-10-06 Thread solafah bh
Hello If I have this vector x=c(5,1,2,9) and n=length(x) and I want to sample one value from x , and each value of x has equal probability to appear (1/n). Are the following codes equivalent?? sample(x,1,replace=TRUE)  and   sample(x,1,replace=TRUE,prob=rep(1/n , n))   Regards [[alternativ

  1   2   3   4   >