Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:02:26+00:00 2026-05-26T07:02:26+00:00

Can someone please help me fill in the following function in R: #data is

  • 0

Can someone please help me fill in the following function in R:

#data is a single vector of decimal values
normally.distributed <- function(data) {
if(data is normal)
return(TRUE)
else
return(NO)
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:02:27+00:00Added an answer on May 26, 2026 at 7:02 am

    Normality tests don’t do what most think they do. Shapiro’s test, Anderson Darling, and others are null hypothesis tests AGAINST the the assumption of normality. These should not be used to determine whether to use normal theory statistical procedures. In fact they are of virtually no value to the data analyst. Under what conditions are we interested in rejecting the null hypothesis that the data are normally distributed? I have never come across a situation where a normal test is the right thing to do. When the sample size is small, even big departures from normality are not detected, and when your sample size is large, even the smallest deviation from normality will lead to a rejected null.

    For example:

    > set.seed(100)
    > x <- rbinom(15,5,.6)
    > shapiro.test(x)
    
        Shapiro-Wilk normality test
    
    data:  x 
    W = 0.8816, p-value = 0.0502
    
    > x <- rlnorm(20,0,.4)
    > shapiro.test(x)
    
        Shapiro-Wilk normality test
    
    data:  x 
    W = 0.9405, p-value = 0.2453
    

    So, in both these cases (binomial and lognormal variates) the p-value is > 0.05 causing a failure to reject the null (that the data are normal). Does this mean we are to conclude that the data are normal? (hint: the answer is no). Failure to reject is not the same thing as accepting. This is hypothesis testing 101.

    But what about larger sample sizes? Let’s take the case where there the distribution is very nearly normal.

    > library(nortest)
    > x <- rt(500000,200)
    > ad.test(x)
    
        Anderson-Darling normality test
    
    data:  x 
    A = 1.1003, p-value = 0.006975
    
    > qqnorm(x)
    

    enter image description here
    enter image description here

    Here we are using a t-distribution with 200 degrees of freedom. The qq-plot shows the distribution is closer to normal than any distribution you are likely to see in the real world, but the test rejects normality with a very high degree of confidence.

    Does the significant test against normality mean that we should not use normal theory statistics in this case? (another hint: the answer is no 🙂 )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please help me figure out a way to achieve the following (see
Please can someone help? I have the following code which uploads a file to
Can someone please help me with the jquery's clone() function? Is there a way
Can someone please help me understand the following: In the previous version of NHibernate
Can someone please help with the following: I am trying to force an asp.net
Can someone please help convert the following into LINQ To SQL query? select *
Can someone please help me convert the following two lines of python to C#.
Can someone please help me write the following, without using dot notation: self.bounds.size.width I
Can someone please help me out with printing the contents of an IFrame via
Can someone please help me? In Perl, what is the difference between: exec command;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.