Question

In: Math

Use SAS. Please include the code and the answers. 1. Generate 625 samples of size 961...

Use SAS. Please include the code and the answers.

1. Generate 625 samples of size 961 random numbers from U(1, 9).

For each of these 625 samples calculate the mean:

a) Find the simulated probability that the mean is between 5 and 5.2.

b) Find the mean of the means.

c) Find the standard deviation of the means.

d) Draw the histogram of the means.

Solutions

Expert Solution

Sas Code:

/* Here we have to generate 625 samples of size 961 from U(1,9)*/

/* Here a = 1 and b = 9 */

%let ns = 961; /* sample size */

%let n = 625; /* Number of samples*/

%let a =1;

%let b= 9;

data a(keep =s1-s&n) ;

array s{&n};

do j = 1 to &ns;

      do i = 1 to &n;

            u=rand("uniform");            *Sample from uniform;

            x = &a+ (&b-&a)*u;

            s{i} = x;

      end;

output;

end;

run;

/* Calculating mean for each sample s1 to s625*/

proc means data = a mean ;

      var s1-s&n;

      output out = b;*(drop = _:);

run;

* a);

data c(keep = prob );

      set b(firstobs=4 obs = 4);

      array s{&n};

      cnt=0;

      do i = 1 to &n;

      if s{i} > 5 and s{i}<5.2 then cnt = cnt+1;

      end;

      prob = cnt/&n;

run;

/*Mean of means and standard deviation*/

*b,c);

proc transpose data =b(drop = _: firstobs = 4 obs=4) out = d;

run;

proc means data = d mean std;

      output out = e;

run;

/*d*/

proc univariate data =d;

      histogram col1;

run;


Related Solutions

What is the code in Rstudio or R? (a) Generate 200 random samples of size n...
What is the code in Rstudio or R? (a) Generate 200 random samples of size n = 10 from a Poisson distribution with mean λ = 12. i. Calculate sample means for each sample. Report the first 10 sample means. ii. Draw a histogram of the sample means (where the y-axis is the density) and fit a density estimate (default density estimator is ok). iii. What is your finding about the sampling distribution of the sample mean, based on your...
Using SAS is preferred but not required. Please provide SAS code and the relevant output if...
Using SAS is preferred but not required. Please provide SAS code and the relevant output if SAS is used. •             Link to referenced FEV.CSV: https://drive.google.com/open?id=1t1CRIbnTE7xL_OE9Bmajb564RXcg8nDo For all hypothesis testing problems: •             state the null and alternative hypotheses, •             calculate the value of the test statistic, •             determine if the results are statistically significant (using rejection region or p-value approaches), •             then state your conclusion in terms of the problem. 1.            FEV (forced expiratory volume) is an index of pulmonary function...
Tower of Hanoi problem please use this code #pragma once #include #include #include #include using namespace...
Tower of Hanoi problem please use this code #pragma once #include #include #include #include using namespace std; class TowersOfHanoi { friend ostream& operator<<(ostream& sink, const TowersOfHanoi& towers); public: //constructor TowersOfHanoi(); //custom methods unsigned move(unsigned new_n_disks = 6, ostream& new_sink = cout); private: //custom methods void move_aux(ostream& sink, unsigned n_disks, unsigned srce, unsigned dest, unsigned aux); //temporary variable unsigned _n_moves; //data const unsigned _n_towers; stack* _tower; }; #include "TowersOfHanoi.h" // ostream& operator<<(ostream& sink, const TowersOfHanoi& hanoi) { for (unsigned index =...
Using SAS programming Please include the syntax and output of the information: In a study of...
Using SAS programming Please include the syntax and output of the information: In a study of factors thought to be responsible for the adverse effects of smoking on human reproduction, cadmium level determinations (nanograms per gram) were made on placenta tissue of a sample of 14 mothers who were smokers and an independent random sample of 18 nonsmoking mothers. The results were as follows- Nonsmokers: 10.0, 8.4, 12.8, 25.0, 11.8, 9.8, 12.5, 15.4, 23.5, 9.4, 25.1, 19.5, 25.5, 9.8, 7.5,...
Using SAS programming Please include the syntax and output of the information: In a study of...
Using SAS programming Please include the syntax and output of the information: In a study of factors thought to be responsible for the adverse effects of smoking on human reproduction, cadmium level determinations (nanograms per gram) were made on placenta tissue of a sample of 14 mothers who were smokers and an independent random sample of 18 nonsmoking mothers. The results were as follows- Nonsmokers: 10.0, 8.4, 12.8, 25.0, 11.8, 9.8, 12.5, 15.4, 23.5, 9.4, 25.1, 19.5, 25.5, 9.8, 7.5,...
Tower of Hanoi problem complete the problems please use this code #pragma once #include <iostream> #include...
Tower of Hanoi problem complete the problems please use this code #pragma once #include <iostream> #include <stack> #include <string> #include <vector> using namespace std; class TowersOfHanoi { friend ostream& operator<<(ostream& sink, const TowersOfHanoi& towers); public: //constructor TowersOfHanoi(); //custom methods unsigned move(unsigned new_n_disks = 6, ostream& new_sink = cout); private: //custom methods void move_aux(ostream& sink, unsigned n_disks, unsigned srce, unsigned dest, unsigned aux); //temporary variable unsigned _n_moves; //data const unsigned _n_towers; stack<unsigned>* _tower; }; #include "TowersOfHanoi.h" // ostream& operator<<(ostream& sink, const...
** Please use only Rstudio and include code ** The target activation force of the buttons...
** Please use only Rstudio and include code ** The target activation force of the buttons on a clicker is 1.967 newtons. Variation exists in activation force due to the nature of the manufacturing process. A sample of 9 clickers showed a mean activation force of 1.88 newtons. The population standard deviation is known to be 0.145 newton. Too much force makes the keys hard to click, while too little force means the keys might be clicked accidentally. We want...
please use linux or unix to complete, and include pictures of the output. Modify the code...
please use linux or unix to complete, and include pictures of the output. Modify the code below to implement the program that will sum up 1000 numbers using 5 threads. 1st thread will sum up numbers from 1-200 2nd thread will sum up numbers from 201 - 400 ... 5th thread will sum up numbers from 801 - 1000 Make main thread wait for other threads to finish execution and sum up all the results. Display the total to the...
Please write SAS code 1) How to find age<65*Female? 2) How to assign region for the...
Please write SAS code 1) How to find age<65*Female? 2) How to assign region for the below description? Age < 65 Age ≥ 65 Total N Sex      Male      Female Region      Northeast      Midwest      South      West Race      White      Black      Asian      All other race groups Table 1: RACERPI2: 01 – White Only (New Category: White) 02 – Black/African American Only (New Category: Black) 03 – AI/AN Only (New Category: All Other Race Groups) 04 – Asian Only (New Category: Asian) 05 – Race...
I need the code in SAS and R and outputs please 2. The data below come...
I need the code in SAS and R and outputs please 2. The data below come from a study investigating a method of measuring body composition, and give the body fat percentage (% fat), age and sex for 18 adults aged between 23 and 61 years. Source: Mazess, R.B., Peppler, W.W., and Gibbons, M. (1984) Total body composition by dual-photon (153GD) absorptiometry. American Journal of Clinical Nutrition, 40, 834-839. age % fat sex 23 9.5 male 23 27.9 female 27...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT