Questions tagged [power-analysis]

33 questions
0
votes
0 answers

Do concepts of effect size, power, and power analysis still make sense in the Bayesian framework?

I do experiments on human language comprehension and encountered the question of sample size, effect size, and power analysis while designing my studies. At the same time, I ran Bayesian statistic models using brms in R. My question is, do the…
Hanacl_
  • 63
  • 4
0
votes
1 answer

P value and sample size relationship

Say for a 2x2 experiment, the power analysis said the sample size should be over 1000 to detect 0.1 effect size. Right now, with the sample size of below 100, the effect size of .12 is insignificant with the p value being 0.8 (very far from .05) Is…
0
votes
0 answers

Power analysis: Model comparison with LRT in R

Any suggestions on how to best implement a power analysis in R when having a binomial generalized linear mixed model (glmm) with 2 categorical predictors as fixed effects (2 levels and 8 factor levels) and testing hypotheses through model comparison…
Sahila
  • 35
  • 5
0
votes
0 answers

Issues with powerSim: new levels detected in new data: 120, 125, 336, 347"

I'm running into an issue where I receive the following error when trying to use powerSim to estimate power for my multilevel model. All my variables including DV and IV are continuous variables. Here are my codes for my model and powerSim. #sample…
0
votes
0 answers

How to fix error and warning messages in power simulation for linear mixed model (lmer)

I would like to do a power simulation in R to plan the sample size for my master thesis study in Psychology. I'm using a linear mixed model with two fixed effects, conflict and openness, and random effects for subjects (persons) and item…
Anne B
  • 1
  • 1
0
votes
0 answers

Code for the Arduino Nano ATMega328p (AES128; AddRoundKey & SubBytes)

I'm working on the project on breaking AES128 on Arduino (Nano) board. I'm using Arduino IDE. My programming skills aren't great, unfortunately. I need to implement AddRoundKey + SubBytes. There's the pseudocode that I've found (Thank you Owen Lo,…
0
votes
0 answers

How to calculate Type I error and Type II error by varying the sample sizes in (5, 10, 15, ..., 195, 200)? And plot these on a graph?

I have calculated the Type 1 and Type II error for the following data: np.random.seed(1005) mean = 5 # Population mean std = 4 # Population std n = 50 # Sample size samples = np.random.normal(loc=mean, scale=std, size=n) # Generate the…
0
votes
0 answers

error in Mixedpower: "... replacement has X rows, data has Y"

I am using mixedpower following the notebook of Kumle et al here My code is as follows: powerfull1 <- mixedpower(model=full1, data=alldum, fixed_effects= c("core.non"), simvar="ID", steps=c(250, 275, 300, 325, 350), critical_value=2, n_sim =…
0
votes
0 answers

Power Analysis for Conditional Poisson Regression

Me and my colleagues have conducted a self-matched case series study to assess the adverse event following immunization. We have used "Conditional Poisson Regression" to assess the risk of the vaccine. After obtaining the Incidence Risk Ratio and…
0
votes
1 answer

How to solve a single inequality equation in R?

I'm using Tim Gerrodette's inequality equation (1987), to look at power analysis of visual survey data, however i'm struggling of finding away to solve this for x, using R. I have the following equation r^2 * n^3 > 12*cv^2(za/2 + zB)^2 where r=0.02,…
0
votes
0 answers

R: how to compute a power analysis based on a wilcoxon test for paired observations (Wilcoxon signed-rank test)

I want to know if my study and my statistical test is powerful. I have 16 subjects, all of them took both treatment1 and treatment2. I want to know if the study is powerful by conducting a power analysis to determine the power of the study. Group 1…
0
votes
0 answers

How to conduct a chi square power analysis testing multiple proportions using the R pwr package and a nested for loop?

I am trying to conduct a power analysis for a chi square test and am struggling quite a bit. I would like to see how many individuals are needed for a study, given that the expected proportion of people with an outcome is 0.1, 0.3, 0.5, and 0.7. I'd…
gbg
  • 69
  • 5
0
votes
0 answers

Saving Power Analysis PWR package results to a df

I'm running a number of power analyses, testing different observation sizes keeping all else equal, and would like to save the results as rows in a dataframe so that I can visualise them later in ggplot. results_df <- data.frame() # create function…
0
votes
0 answers

Power analysis for loglinear model

I have a loglinear model. How can I perform power analysis on it? Using an example dataset: library(MASS) UCBAdf <- as.data.frame(UCBAdmissions) My loglinear model: glmFitT <- glm(Freq ~ Admit * Dept * Gender, family=poisson(link="log"),…
cliu
  • 933
  • 6
  • 13
0
votes
1 answer

Statsmodels power analysis number of observations

I'm confused with statsmodels API of the TTestIndPower class. In the plot_power function the number of observations plotted are the total number of samples or the number of samples of each group?
Emanuel
  • 422
  • 7
  • 12