Applying stats in R software
Budget: $10 – $30 USD
Urgent Project
Solve the excersies in R software and send as a pdf file.
Due Date: Dec 14
1) Sampling Suppose you are running the lottery in a weekly lottery, where 5 out of 55 unique numbers are drawn. You should create an algorithm/notebook , such that:
1. Draw the winning numbers for each week.
2. Saves the winning numbers for 100 weeks in a csv file.
3. Reads the winning numbers from a csv file, then combines all numbers in a single vector and plots their histogram. What distribution would you use to describe theoretically the collection of the data, approximately?
2)Normal Distribution Let X ∼ N (2, 12). Create an algorithm/notebook that:
1. Generates 100 random numbers from this distribution, creates a histogram of those values and saves the plot in a pdf.
2. Compute the 99% percentile of the given distribution N (2, 12).
3. ComputeP(|Z|≤1.64)by using the function pnorm(), where Z is a standard
normal variable.
4. Compute P (X ≤ 1) by using the function pnorm() and explain how you did it.
5. Compute the expected value of Z3 using the function integrate() and store the result in a new value named third moment. Then. compute the expected value of X ^3
3) 1. Search through the topics. Identify a topic and then a dataset you like. You can choose one from the two provided
- Data on International Trade found in https://sites.google.com/site/ hiegravity/data-sources?authuser=0
• Any dataset that has been made in csv format here https://corgis-edu. github.io/corgis/csv/. These are the easiest to use.
2. Create a notebook that reads the data. Shows the first few lines of the data. Explain the data (variables included).
3. In the same notebook: Summarize 2 variables calculating their sample mean and the sample standard deviation. Describe the variables.
4. In the same notebook: Create a histogram for a variable that interests you and provide a short paragraph explaining what the histogram shows.
5. In the same notebook: Create a scatterplot for two variables that interest you and provide a short paragraph explaining what the scatterplot shows. Calculate the sample correlation of the variables and describe.
4) Confidence Intervals
The Current Population Survey (CPS) is a monthly survey of households con- ducted by the Bureau of Census for the Bureau of Labor Statistics. It provides a comprehensive body of data on the labor force and labor force characteris- tics in the US. An aggregated version of the data can be found here: https: //corgis-edu.github.io/corgis/csv/labor/. Create a notebook that
1. Reads the data. As you can see the data contain values by 3 racial groups and gender.
2. Applies the following in the data. Keeps the data only after January 2000.
3. Creates the variables that counts the number of people employed (call it ne), number of people unemployed (call it nun) and number of people not in the labor force (call it nlf). Then creates a variable that calculates, for all the population the Labor Force Participation rate defined as 1 - (workers not in the labor force)/(all workers) and a value for the unemployment rate defined as unemployed/(workers in labor force).
4. Calculates the average unemployment from the start of the 2000s.
5. For a single worker, what value can the variable in labor force take? What type of distribution can be used to describe the workers in terms of the variable participation in labor force.
6. With the data from the CPS survey, how can you find a value for the unknown population parameter(s) that summarize(s) the distribution assumed above?
7. Find the 0.975 quantile of the normal distribution and calculate a 95 percent CI for the average monthly participation rate of workers from the start of 2000.
Solve the excersies in R software and send as a pdf file.
Due Date: Dec 14
1) Sampling Suppose you are running the lottery in a weekly lottery, where 5 out of 55 unique numbers are drawn. You should create an algorithm/notebook , such that:
1. Draw the winning numbers for each week.
2. Saves the winning numbers for 100 weeks in a csv file.
3. Reads the winning numbers from a csv file, then combines all numbers in a single vector and plots their histogram. What distribution would you use to describe theoretically the collection of the data, approximately?
2)Normal Distribution Let X ∼ N (2, 12). Create an algorithm/notebook that:
1. Generates 100 random numbers from this distribution, creates a histogram of those values and saves the plot in a pdf.
2. Compute the 99% percentile of the given distribution N (2, 12).
3. ComputeP(|Z|≤1.64)by using the function pnorm(), where Z is a standard
normal variable.
4. Compute P (X ≤ 1) by using the function pnorm() and explain how you did it.
5. Compute the expected value of Z3 using the function integrate() and store the result in a new value named third moment. Then. compute the expected value of X ^3
3) 1. Search through the topics. Identify a topic and then a dataset you like. You can choose one from the two provided
- Data on International Trade found in https://sites.google.com/site/ hiegravity/data-sources?authuser=0
• Any dataset that has been made in csv format here https://corgis-edu. github.io/corgis/csv/. These are the easiest to use.
2. Create a notebook that reads the data. Shows the first few lines of the data. Explain the data (variables included).
3. In the same notebook: Summarize 2 variables calculating their sample mean and the sample standard deviation. Describe the variables.
4. In the same notebook: Create a histogram for a variable that interests you and provide a short paragraph explaining what the histogram shows.
5. In the same notebook: Create a scatterplot for two variables that interest you and provide a short paragraph explaining what the scatterplot shows. Calculate the sample correlation of the variables and describe.
4) Confidence Intervals
The Current Population Survey (CPS) is a monthly survey of households con- ducted by the Bureau of Census for the Bureau of Labor Statistics. It provides a comprehensive body of data on the labor force and labor force characteris- tics in the US. An aggregated version of the data can be found here: https: //corgis-edu.github.io/corgis/csv/labor/. Create a notebook that
1. Reads the data. As you can see the data contain values by 3 racial groups and gender.
2. Applies the following in the data. Keeps the data only after January 2000.
3. Creates the variables that counts the number of people employed (call it ne), number of people unemployed (call it nun) and number of people not in the labor force (call it nlf). Then creates a variable that calculates, for all the population the Labor Force Participation rate defined as 1 - (workers not in the labor force)/(all workers) and a value for the unemployment rate defined as unemployed/(workers in labor force).
4. Calculates the average unemployment from the start of the 2000s.
5. For a single worker, what value can the variable in labor force take? What type of distribution can be used to describe the workers in terms of the variable participation in labor force.
6. With the data from the CPS survey, how can you find a value for the unknown population parameter(s) that summarize(s) the distribution assumed above?
7. Find the 0.975 quantile of the normal distribution and calculate a 95 percent CI for the average monthly participation rate of workers from the start of 2000.