DATA Step, Macro, Functions and more

Hypothesis test

Reply
Contributor
Posts: 22

Hypothesis test

I am trying to perform a hypothesis test to determine if more than 10% of cereals are manufactured by Post. Significance level=0.10. 

Here it is my code and the data set: 

 

 

DATA cereal;
INFILE "/folders/myfolders/cereal.txt"
DLM=',' FIRSTOBS=2 DSD MISSOVER;
INPUT Name :$50. Manufacturer $ Type $ Calories Protein Sodium Fiber Carbohydrates Sugars Potassium Vitamins Weight Cups;
RUN;

PROC PRINT DATA=cereal;
RUN;

PROC TTEST DATA= Cereal;
VAR Manufacturer;
RUN;

 

Valued Guide
Posts: 558

Re: Hypothesis test

CLASS statement contains the variable that distinquishes the groups being compared.
VAR statement specifies the response variable to be used in calculations.

 

FYI: http://www.math.wpi.edu/saspdf/stat/chap67.pdf

Thanks,
Suryakiran
Respected Advisor
Posts: 2,802

Re: Hypothesis test


@Miah wrote:

I am trying to perform a hypothesis test to determine if more than 10% of cereals are manufactured by Post. Significance level=0.10. 



 

PROC TTEST will not perform the hypothesis test you are describing, nor will it even compute the percent of cereals manufactured by POST.

 

PROC FREQ will compute the percent of cereals manufactured by each manufacturer. The BINOMIAL option in the TABLES statement will perform the desired hypothesis test. http://documentation.sas.com/?docsetId=procstat&docsetTarget=procstat_freq_examples04.htm&docsetVers...

--
Paige Miller
PROC Star
Posts: 8,145

Re: Hypothesis test

The question you have to ask yourself is "have you met the prerequisites" for whatever analysis you want to do.

 

Do your 77 records represent a random sample of all cereal types (e.g., see https://en.wikipedia.org/wiki/List_of_breakfast_cereals )?

 

The simple question of whether Post cereals represent at least 10% of those represented in your data, a simple proc freq shows that to be true. But statistics (other than descriptive) can't (I don't think) provide what you're looking for unless you meet the assumptions of the analysis you want to do.

 

Art, CEO, AnalystFinder.com

 

Ask a Question
Discussion stats
  • 3 replies
  • 131 views
  • 0 likes
  • 4 in conversation