Questions tagged [power-analysis]

33 questions
6
votes
1 answer

Running a power analysis on a lavaan latent growth curve model

I am trying to conduct a power analysis using semTools on a latent growth curve model estimated using lavaan. See below: library(RCurl) library(lavaan) library(semTools) x <-…
histelheim
  • 4,938
  • 6
  • 33
  • 63
3
votes
1 answer

Why R pwr.2p.test gives different sample size than G*Power?

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 proportion power calculation for binomial distribution (arcsine…
L.Yang
  • 553
  • 1
  • 6
  • 12
2
votes
1 answer

How to generate a negative binomial distribution with different sample sizes for power analyses in R?

I try to do a power simulation with an outcome variable that is zero-inflated. So I use a negative binomial distribution. What I need is the following distribution: library(tidyverse) set.seed(123) rt_random <- rnbinom(n = 2000, mu = 25, size = .9)…
PNP95
  • 23
  • 4
2
votes
1 answer

Sample size calculation for experimental design

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=0.8). Questions I understand that we need the…
Arijit
  • 21
  • 2
1
vote
0 answers

Power analysis errors with simr

HI I am trying to run a power analysis with simr and I am getting some errors. This is my model code and simr code. The error I get is "non-conformable arguments" I do not have any NAs, so I am not sure what might be causing the error. How do I fix…
1
vote
0 answers

Calculate p-value from a distinct frequency

I am looking for the p-value at the frequency close to 90 days in my 365-day timeseries, but the Lomb package only calculates the highest power p-value: ts = runif(365, 3, 18) library(lomb) lsp(ts,to=365,ofac=10,plot=FALSE,type='period') The root…
1
vote
0 answers

Building power simulation from scratch (simr)

I have some troubles building my mixed model power simulation in simr. I have some statistical learning gaps so please be kind :) I want to run a simulation for a longitudinal single-group study with 6 assessment points in which a continuous outcome…
Blubbb
  • 11
  • 2
1
vote
1 answer

Simulating data for makeLmer function in simr package

I'm trying to create some simulated data for use in the simr package via the makeLmer function. I'm trying to produce a data set with 110 participants in a 2 x 2 x 2 within subjects factorial model. This makes 156 trials on a computerized task per…
Tom Denson
  • 11
  • 2
1
vote
0 answers

power analysis in simr - object is not a matrix

I have the following model: ModelPower <- lmer(DV ~ GroupAbstract * Condition_Cat_Abs + (1|Participant) + (1 + GroupAbstract|Stimulus), data = Dataset) This model gives the following output: Random effects: Groups Name …
Joseph K.
  • 57
  • 5
1
vote
1 answer

Small sample size error using power calculation for two proportions

I am trying to use power analysis for sample size selection using the pwr library in R. library(pwr) pwr.2p2n.test(h = 0.1, n1 = 78, power = 0.8, sig.level = 0.0125) I get the following error: Error in uniroot(function(n2) eval(p.body) - power, c(2…
Kreitz Gigs
  • 369
  • 1
  • 9
1
vote
2 answers

De-activating the Core Voltage Regulator to Perform Power Analysis on STM32F407 DISCOVERY Board

I am trying to perform Power Analysis (Side-Channel Attack) on AES-128 that I have implemented on STM32F407 DISCOVERY MCU. I have found out that I can measure with a current probe from VCap1 and Vcap2 . To do so, the regulator that feeds the core…
1
vote
0 answers

How to do power analysis in post-hoc test of GAM?

I wonder if there is a possibility of doing power analysis for post-hoc test for GAM? I am specifically interested in a sample size necessary to achieve a desired power. My GAM looks like this: library(mgcv) set.seed(123) n = 500 dat <-…
1
vote
0 answers

Sensitivity Power Analysis with CLMM2

I'm trying to perform a sensitivity power analysis in R with clmm2. I'm building off the code from this post (Trying to use tidy for a power analysis and using clmm2) but am running into issues with inputting desired beta estimates into the…
ftPzTQY
  • 11
  • 1
0
votes
0 answers

Using pwr.2way in R: how to think about size.A and size.B arguments?

first time posting a question here, I appreciate any help you might have. I am trying to do a two-way ANOVA power analysis in R, and I am trying to use the pwr.2way function from the pwr2 package. I haven't found much help for it online besides the…
0
votes
0 answers

How do I address "Error in attr(test, "text")(fit, sim) : attempt to apply non-function" when a running mixed effect model power analysis with simR?

I'm trying to run a power analysis with an archival dataset using the simR package.I found a helpful guide here: https://pablobernabeu.github.io/2023/ggplotting-power-curves-from-simr-package/. When I initially ran everything about 2 weeks about, it…
1
2 3