Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
1 replies
91 views

I'm trying to calculate a sample size for a phychological study where the purpose of the study is to see if patients can maintain a score at baseline during 3 follow up measurements. The mean baseline ...
Ando's user avatar
  • 35
0 votes
0 answers
23 views

I want to conduct an a priori power analysis to determine the necessary sample size for a proposed project. I will estimate a regression between two continuous variables with a binary moderator (...
medusa's user avatar
  • 45
0 votes
0 answers
24 views

My company sells a large number of medical device implants per year. There are often "incidents" or minor issues, associated with them that can be easily categorized into an incident ...
empanadero96's user avatar
-1 votes
1 answer
118 views

I am currently setting up a multicenter RCT of a treatment versus placebo (1:1), with a primary outcome of prolongation of pregnancy in days. The minimal clinically relevant difference in days is 5 ...
Catherina Muscat's user avatar
0 votes
0 answers
172 views

I am trying to decide the appropriate model and perform power analysis. Suppose a data contains 2 groups (A,B) and 28 participants from each group. All of those participants are measured 15 times on ...
ksing's user avatar
  • 39
0 votes
0 answers
181 views

I am performing the quantile regression in R on a non linear model. I am getting the coefficients for the desired quantiles (tau = 0.05, 0.50, 0.95). All very nice, but running the code without ...
M B's user avatar
  • 13
0 votes
0 answers
27 views

I was trying to rework the examples in Epidemiology Study Design and Data Analysis by Mark Woodward using R. Example 8.12 deals with calculation of sample size to test for a population proportion of ...
Ajith's user avatar
  • 13
1 vote
1 answer
245 views

I would have a neuroimaging study (this possibly might be aside or help to figure out the problem). Participants are called to fill out a questionnaire, that turns a score in terms of technology usage....
12666727b9's user avatar
  • 1,147
0 votes
0 answers
292 views

I am trying to create a stacked bar plot with both error bars and sample sizes in R, using ggplot, geom_bar, and geom_errorbar. The labels and error bars are overlapping, and I'm trying to avoid that. ...
HannahM's user avatar
0 votes
0 answers
34 views

`There exists r such that: \sum_{i=r}^{n}{\left(\frac{n!}{i!(n-i)!}\right)\left(\pi_0^i\right){(1-\pi_0)}^{\left(n-i\right)}\le\alpha} \sum_{i=r}^{n}{\left(\frac{n!}{i!(n-i)!}\right)\left(\pi_1^i\...
sirajum munira khan's user avatar
0 votes
2 answers
5k views

A version of this question has been asked a few times but never in the simplest way. Basically, the stats::chisq.test function doesn't work when the sample sizes between the two groups are uneven, ...
Bradley Allf's user avatar
1 vote
0 answers
1k views

I would like to calculate a sample size for 3 groups based on the mean for each of the three groups of an continuous variable (Flow per min). Its a randomised study with an allocation ratio of 1:1:1. ...
Sofie L's user avatar
  • 23
2 votes
0 answers
288 views

I have one control group and two treatment groups. I know the sample size formulae for comparing two proportions. n = (Zα/2+Zβ)2 * (p1(1-p1)+p2(1-p2)) / (p1-p2)2, Can someone please help me what the ...
prasadav's user avatar
  • 190
1 vote
1 answer
63 views

I have a larger dataset and below is a subset of that data. The category is the dependent variable and Day_1 and Day_2 are independent variables. ID <- c("e-1", "e-2", "e-3&...
Niro Mal's user avatar
  • 117
0 votes
1 answer
3k views

I am new to R and trying to add count labels to my boxplots, so the sample size per boxplot shows in the graph. This is my code: bp_east_EC <-total %>% filter(year %in% c(1977, 2020, 2021, ...
user207306's user avatar
-1 votes
1 answer
205 views

I tried with the "solutions" from other posts without success. So, I am trying to add to my ggplot2 barplot the sample size per group under the names at the x-axis. I am using the ...
Carmen O's user avatar
1 vote
1 answer
581 views

I'm trying to create a line plot like this one (made on Powerpoint): showing the dependency of weight on age (weight~age), for 3 subgroups (so each group has its own line). I also want the chart to ...
Maya Eldar's user avatar
0 votes
1 answer
158 views

I'd like to display the sample size of each species on my boxplot, but the plot is fairly cluttered. Is there a way to display the sample size on the "outside" of the plot with "N" ...
Nate's user avatar
  • 489
1 vote
1 answer
1k views

I have a large data frame that contains lots of NAs. The rows are soil samples from different plots, and the columns are chemical variables. I wanted to create a column or data frame with the sample ...
user18633784's user avatar
1 vote
2 answers
383 views

I am trying to get the sample size for a single AUC using power.roc.test in the pROC package. For example, the expected AUC is 0.97 (alternative hypothesis) and the value I am comparing to is 0.95 (...
slee's user avatar
  • 11
1 vote
1 answer
70 views

I have grouped data, where every one of the bars has a different sample size, ranging from 0 samples to >600. I would like to have 2 more panels of this same graph for different data, and that ...
Erin's user avatar
  • 11
0 votes
2 answers
278 views

Here is my code : for (p in 1:10){ sample=rgamma(p,p,1)} Here is what I get [1] 1.841629 [1] 2.174076 1.410500 [1] 2.398601 4.674819 2.679830 [1] 2.736786 3.767747 4.546256 3.851677 [1] 4.204808 8....
johnylulu's user avatar
0 votes
0 answers
462 views

I'm new to clmm and run into the following problem: I want to obtain the optimal sample size for my study with R using powerSim and powerCurve. Because my data is ordinal, I'm using a clmm. Study ...
Carl_Menzies's user avatar
0 votes
1 answer
673 views

I have a dataframe with about 1700 observations (rows) in 29 variables (columns) and I have to select a mixture of 7 of these observations for which the weighted mean (of each variable) is as equal as ...
User3101's user avatar
0 votes
0 answers
221 views

In my master thesis, I need to determine and calculate the number of cases for median time to event. The method is according to Brookmeyer & Crowley, 1982. My question is: How can I determine the ...
Nareen Al Haj's user avatar
5 votes
1 answer
1k views

I want to know the sample size required. In R library(pwr) pwr.2p.test(h = ES.h(0.022,0.001),sig.level = 0.05,power = 0.8,alternative = "greater") gives the results Difference of ...
L.Yang's user avatar
  • 593
0 votes
1 answer
424 views

I am using pingouin.power_anova(eta=None, k=None, n=None, power=None, alpha=0.05) in python for the calculation of sample size. I have the information about control_group_historic_mean, ...
Riteek Srivastava's user avatar
2 votes
1 answer
466 views

I have three treatments (Wild type, Mutant1 and Mutant2); I request inputs on how to decide the sample size that would be statistically significant (alpha <0.05) with high statistical power (1-beta=...
Arijit's user avatar
  • 21
0 votes
1 answer
439 views

What are "weights" and "weights" in Conditional CARTs? I am analysing a small data set (N=70) by recursive partitioning using CARTS. Specifically, the ctree function form the party ...
Cris's user avatar
  • 21
0 votes
1 answer
340 views

I'm new to computer simulations and R programming as a new module I had to study in college I had some issues understanding the problem asking in an exercise The code I'm trying with : runs <- ...
therealwalim's user avatar
1 vote
1 answer
492 views

I need to determine the appropriate sample size to estimate p in a binomial process, using R. I see the package binomSamSize, but I do not see sample size determinations using Clopper-Pearson.
user6883405's user avatar
1 vote
0 answers
988 views

I am trying to perform a sample size calculation in SAS for a two sample time to event case. Here is the situation: Assume both sample follows exponential distribution Assume a given constant hazard ...
battousai1983's user avatar
0 votes
0 answers
33 views

I was handed over a nice data set (reds) examining acorn morphology and parasites (weevils) for many trees over several years. However, the sample sizes for each tree are highly variable (5 - 75 ...
Jeff Stratford's user avatar
0 votes
1 answer
1k views

I want to calculate sample size by using the mcnemar test to compare 2 values ​​of sensitivity. I am looking for the formula to implement under r for this calculation. In this case i need to calculate ...
user avatar
1 vote
2 answers
2k views

I am plotting students' data from different schools to see the difference between male and female student numbers at some majors. I am using python, I already plot the data for some schools and as I ...
sam_sam's user avatar
  • 479
1 vote
0 answers
277 views

When using the longpower package in R for calculating statistical power and, respectiely, sample size: How do I know which of the functions of the longpower package I should use? Specifically, I am ...
Sventon's user avatar
  • 11
3 votes
0 answers
1k views

fairly new to LSTM, but I already searched for a solution and could not find anything satisfying or even similar enough. So here is my problem: I am dealing with sleep classifaction and have ...
TheShmoo's user avatar
0 votes
1 answer
234 views

I have a problem using the nor.test function as a oneway test in R. My data contain yield value (Rdt_pied) that are grouped by treatment (Traitement). In each treatment I have between 60 and 90 values....
DSR's user avatar
  • 1
0 votes
1 answer
46 views

I am new to R programming and I need help with a problem. I am told that a population is normally distributed with a mean of 4 and a standard deviation of 4. The size of the population is 10000000. ...
zoskybuck's user avatar
0 votes
1 answer
273 views

I am using the googleAnalyticsR package in R to pull some website visit stats and calculate conversion rates. No problem thus far. However, I have become stuck when trying to calculate the required ...
jimiclapton's user avatar
0 votes
2 answers
127 views

What is the minimum sample size n (or the length n = length(x) of the data vector x) such that the difference D = 1 - statx4(x)/statx5(x) of the functions statx4 and statx5 is no more than 1/100 i.e. ...
Mauri's user avatar
  • 3
1 vote
0 answers
325 views

NB: this question has been cross-posted as this GitHub issue. I am estimating sample size based on the data from a previous experiment that included 40 participants. I used simr::powerCurve for ...
Zhenya K.'s user avatar
  • 355
0 votes
0 answers
99 views

I need to do power calculations for a 3 arm trial (to determine minimum detectable effect size, given the alpha, power, sample size etc). I found the R package Three.Arm.Trials, however I was ...
Smriti Ganapathi's user avatar
3 votes
3 answers
5k views

I have a data set with around 130000 records. The records divided in two class of target variable,0 & 1. 1 contains only 0.09% of total proportion. I'm running my analysis in R-3.5.1 on Windows ...
Sonia's user avatar
  • 482
1 vote
0 answers
181 views

This question was already asked on stats.stackexchange, but no one answered. Since I'm not sure which forum is the appropriate one, I post this here again with some data. I have done experiments on ...
bamphe's user avatar
  • 328
0 votes
0 answers
504 views

I'm calculating the NPS (Net Promoter Scores) for about 50 different sessions at a recent event. Each session was attended by about 50-500 people, and the number of survey responses for each session ...
Greg L's user avatar
  • 1
0 votes
1 answer
1k views

I am having a model built with nlme::lme, with only one random effect (ID) and one binary independent variable (x). I am now trying to use this model to do a sample size calculation. Linear mixed-...
GiannisZ's user avatar
  • 153
0 votes
0 answers
378 views

I would like to produce some power curves with effect size on the x axis, and power on the y axis. I am only slightly modifying the code from this source: https://moderndata.plot.ly/power-curves-r-...
h09812349's user avatar
  • 173
1 vote
1 answer
508 views

I'm trying to compute a sample size for a study that has 5 groups. Aside from computing Cohen's f for the overall ANOVA, how can I compute a sample size for each group that adjusts for pairwise post-...
Mircea_cel_Batran's user avatar
0 votes
0 answers
54 views

I have a data.frame with two columns $P1 and $P2, both numeric. I'd like to run the power.prop.test in library(stats),by row, and have a third column created that prints only the $n value from the ...
Mircea_cel_Batran's user avatar