Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the efficacy Analysis in R language

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

It is believed that many inexperienced people have no idea about how to understand the efficacy analysis in R language. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Before we conduct our research, we are often asked: there are now x available subjects for my research. Is such a study worth doing? Or "how many subjects do you need for my research?" This kind of problem needs to be solved by efficacy analysis.

Basic knowledge of R language:

Sample size: refers to the number of observations in each condition / group in the experimental design

Significance level: defined by the probability of type I error, it can be said that the probability of finding that the effect does not occur.

Efficacy: the probability of a type II error subtracted from I can be seen as the probability of a real effect.

Effect: refers to the amount of effect under alternative and research assumptions. The expression of effect value depends on the statistical method in hypothesis testing. There are four basic quantities of research and design in efficacy analysis. Given any three, you can calculate the fourth one and use the pwr package to achieve efficiency analysis.

Functions in the pwr package:

T-test, the pwr.t.test () function provides many useful power analysis options in the format:

Pwr.t.test (nymphology, pageantry, dregs, sig.levelling, powerwriting, powerwriting, etc.)

Where: n is the sample size

D is the effect value, that is, the difference between the standardized mean

Sig.level indicates the level of significance (default is 0. 05)

Power is the level of efficacy

Type refers to the type of test: double sample t test (two.sample), single sample t test (one.sample) or dependent sample t test (paired). The default is double-sample t-test.

Alternative refers to whether the statistical test is bilateral test (two.sides) or unilateral test (less or greater). The default is bilateral test.

In the experiment of mobile phone and driving reaction time, it is assumed that the double-tailed independent sample t-test will be used to compare the driver's reaction time in the two cases. According to experience, we know that the standard deviation of the reaction time is 1.25s, and the difference of the reaction time of 1s is a huge difference, so in this study, the effect value can be set to 1.25mm 0.8 or greater. In addition, if the difference exists, we hope to have 90% confidence to detect it. Due to the existence of random variability, we hope that 95% will not mistakenly report that the difference is significant. At this time, how many subjects are needed for this study?

> install.package ("pwr")

> library (pwr)

> pwr.t.test (nasty 20 dagger .5 two.sided sig.levelling .01 recorder type = "two.sample", alternative= "two.sided")

Two-sample t test power calculation

N = 20

D = 0.5

Sig.level = 0.01,

Power = 0.1439551

Alternative = two.sided

NOTE: n is number in * each* group

The results showed that each group needed 34 subjects (a total of 68) to ensure that a 0.8 effect value was detected with 90% certainty, and that there was only a 5% chance of misreporting the difference.

After reading the above, have you mastered how to understand the method of efficacy analysis in R language? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report