1. Provide the code that parallelizes the following: library(MKinfer) # Load pa

1. Provide the code that parallelizes the following: library(MKinfer) # Load pa

1. Provide the code that parallelizes the following: library(MKinfer) # Load package used for permutation t-test # Create a function for running the simulation: simulate_type_I <- function(n1, n2, distr, level = 0.05, B = 999,alternative = "two.sided", ...) { # Create a data frame to store the results in: p_values <- data.frame(p_t_test = rep(NA, B),p_perm_t_test = rep(NA, B),p_wilcoxon = rep(NA, B)) for(i in 1:B) { # Generate data: x <- distr(n1, ...) y <- distr(n2, ...) # Compute p-values: p_values[i, 1] <- t.test(x, y, alternative = alternative)$p.value p_values[i, 2] <- perm.t.test(x, y,alternative = alternative,R = 999)$perm.p.value p_values[i, 3] <- wilcox.test(x, y,alternative = alternative)$p.value } # Return the type I error rates: return(colMeans(p_values < level)) } 2. Provide the code that runs the following code in parallel with 4 workers (with mclapply): lapply(airquality, function(x) { (x-mean(x))/sd(x) })

Posted in R

Data Obtain time series data on the price of a commodity. ** I will send the da

Data
Obtain time series data on the price of a commodity. ** I will send the da

Data
Obtain time series data on the price of a commodity. ** I will send the data
Analysis
(1) Transform the data if necessary. (2) Plot the data and tabulate the descriptive statistics. Comment on your observations. (3) Conduct ARIMA modelling. (4) Appraise the adequacy of the results and apply appropriate diagnostic procedures. Which model gives the best ‘fit’? (5) Forecast the commodity price using appropriate forecasting techniques and evaluate your forecast. Select the best model for forecasting. (6) Compare your methods and findings with those of other empirical studies on this topic.

Posted in R

Data Obtain time series data on the price of a commodity. ** I will send the da

Data
Obtain time series data on the price of a commodity. ** I will send the da

Data
Obtain time series data on the price of a commodity. ** I will send the data
Analysis
(1) Transform the data if necessary. (2) Plot the data and tabulate the descriptive statistics. Comment on your observations. (3) Conduct ARIMA modelling. (4) Appraise the adequacy of the results and apply appropriate diagnostic procedures. Which model gives the best ‘fit’? (5) Forecast the commodity price using appropriate forecasting techniques and evaluate your forecast. Select the best model for forecasting. (6) Compare your methods and findings with those of other empirical studies on this topic.

Posted in R

1. Provide the code that parallelizes the following: library(MKinfer) # Load pa

1. Provide the code that parallelizes the following: library(MKinfer) # Load pa

1. Provide the code that parallelizes the following: library(MKinfer) # Load package used for permutation t-test # Create a function for running the simulation: simulate_type_I <- function(n1, n2, distr, level = 0.05, B = 999,alternative = "two.sided", ...) { # Create a data frame to store the results in: p_values <- data.frame(p_t_test = rep(NA, B),p_perm_t_test = rep(NA, B),p_wilcoxon = rep(NA, B)) for(i in 1:B) { # Generate data: x <- distr(n1, ...) y <- distr(n2, ...) # Compute p-values: p_values[i, 1] <- t.test(x, y, alternative = alternative)$p.value p_values[i, 2] <- perm.t.test(x, y,alternative = alternative,R = 999)$perm.p.value p_values[i, 3] <- wilcox.test(x, y,alternative = alternative)$p.value } # Return the type I error rates: return(colMeans(p_values < level)) } 2. Provide the code that runs the following code in parallel with 4 workers (with mclapply): lapply(airquality, function(x) { (x-mean(x))/sd(x) })

Posted in R

Part 1: Understanding Data and Measurement (15 points) Data and Information Hier

Part 1: Understanding Data and Measurement (15 points)
Data and Information Hier

Part 1: Understanding Data and Measurement (15 points)
Data and Information Hierarchy (5 points): Describe the difference between data, information, knowledge, and wisdom, explaining the hierarchical relationship among them. Provide a specific, real-world example to illustrate each level of the hierarchy.
Variables and Measurement Scales (10 points): Explain the different types of variables (nominal, ordinal, interval, and ratio), and describe the associated scales of measurement. Provide a specific example of each type of variable and explain why it is classified as such. Part 2: Descriptive Statistics and Bivariate Analysis (30 points) Frequency Distribution and Summary Measures (15 points): Select a dataset (this could be publicly available data or a dataset from your workplace). Create a frequency distribution for a chosen variable, calculate common summary measures (mean, median, mode, range, variance, and standard deviation), and provide a short interpretation of these measures.
Bivariate Analysis (15 points): With the same dataset or a different one, conduct a bivariate analysis that includes both an association between two qualitative variables and a correlation between two quantitative variables. Interpret your findings. Part 3: Probability and Distributions (30 points) Probability (10 points): Discuss the basic rules of probability, conditional probability, and Bayes’ theorem. Illustrate your discussion with unique examples.
Random Variables and Probability Distributions (20 points): Define discrete and continuous random variables. Give a real-world example of each and describe the associated probability distribution for each variable.
Part 4: Sampling Techniques (20 points)
Sampling (20 points): Define and differentiate random and non-random sampling. Discuss how to determine an appropriate sample size for a given study. Include an illustrative example from a real or hypothetical research study.
Submission Format: The assignment should be approximately 2,000 words. The focus should be on the quality and depth of your responses, rather than meeting a strict word count. Cite your sources in-text and on the reference page in APA format. Write in a clear, concise, and organized manner; demonstrate ethical scholarship in accurate representation and attribution of sources.

Posted in R

The Fat data The Fat data contains the age, weight, height, and ten body circumf

The Fat data
The Fat data contains the age, weight, height, and ten body circumf

The Fat data
The Fat data contains the age, weight, height, and ten body circumference measurements for 252 men. Each man’s percentage of body fat was accurately estimated by an underwater weighing technique.
The data frame contains the following variables:
brozek: Percent of body fat using Brozek’s equation, 457/Density – 414.2
siri: Percent body fat using Siri’s equation, 495/Density – 450
density: Density (gm/cm3)
age: Age (yrs)
weight: Weight (lbs)
height: Height (inches)
adipos: Adiposity index = Weight/Height2 (kg/m2)
free: Fat Free Weight = (1 – fraction of body fat) * Weight, using Brozek’s formula (lbs)
neck: Neck circumference (cm)
chest: Chest circumference (cm)
abdom: Abdomen circumference (cm) at the umbilicus and level with the iliac crest
hip: Hip circumference (cm)
thigh: Thigh circumference (cm)
knee: Knee circumference (cm)
ankle: Ankle circumference (cm)
biceps: Extended biceps circumference (cm)
forearm: Forearm circumference (cm)
wrist: Wrist circumference (cm) distal to the styloid processes
You can access the data using the following statement: data(fat, package = “faraway”)
Question 1
Fit a regression model with the brozek variable (percent of body fat) as a response and the following six predictors: age, neck, abdom, thigh, forearm and wrist.
Show the summary. Which predictors are significant at the 0.05 level?
Question 2
Provide interpretation to the coefficient of each significant predictor
Hints:
Hints: See Lesson 3, Slide 49 and Slide 58.
Question 3
Compute the median value of the six predictors. Store the medians in a variable named x0 and show the values .
Hint: See Lesson 4, Slide 18.
Question 4
Construct a confidence interval of the mean response based on the median values that you stored in x0.
Hint: See Lesson 4, Slide 20.
Question 5
Construct a prediction interval of the next response value based on the median values that you stored in x0.
Hint: See Lesson 4, Slide 20.
Question 6
Which of the two intervals is wider?
Question 7
Construct a confidence interval of the outcome variable for a person with the following characteristics:
Age: 49 years
Neck: circumference: 40 cm
Abdomen: circumference: 95 cm
thigh: circumference: 60 cm
forearm: circumference: 31 cm
wrist circumference: 19.5 cm
Hints:
You can store the predictor values in a new variable named x1. Here is an example of such a variable:
x1 <- c("(Intercept)" = 1, age = 25, neck =34, abdom = 84, forearm = 25, wrist = 25) Note that the intercept should be 1, but you will need to update the values of the predictors.

Posted in R