R language detection data normal distribution _r language

Source: Internet
Author: User


Input

Comments

>

NX <-C (Rnorm (10))

Randomly generates 10 normal distributions of data

>

Nx

View NX

[1] -0.83241783-0.29609562-0.06736888-0.02366562 0.23652392 0.97570959

[7]-0.85301145 1.51769488-0.84866517 0.20691119

View the results

>

Shapiro.test (NX)

Shapiro-wilk method for normal state test

Shapiro-wilk normality Test

Data:nx

W = 0.9084, P-value = 0.2699

Test results because W is close to 1

The P value is greater than 0.05, so the data is a normal distribution and the results of the origin statistic are the same (below)


The normal detection of the Case II-R language Band (Kolmogorov-smirnov method)

Input

Comments

>

NX <-C (Rnorm (10))

Randomly generates 10 normal distributions of data

>

Nx

View NX

[1] -0.83241783-0.29609562-0.06736888-0.02366562 0.23652392 0.97570959

[7]-0.85301145 1.51769488-0.84866517 0.20691119

View the results

>

Ks.test (NX, "pnorm", mean = Mean (NX), SD = sqrt (var (nx))

Shapiro-wilk method for normal state test

Kolmogorov-smirnov test requires three input variables, and the data itself, mean and standard deviation

One-sample Kolmogorov-smirnov Test

Data:nx

D = 0.1828, P-value = 0.8344

Alternative hypothesis:two-sided

Test results, because

P value is greater than 0.05, so the data is normal distribution, and the results of origin statistics are the same



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.