Write a function in R to perform the linear regression

Assignment Help Basic Statistics
Reference no: EM132583612

Questions -

Question 1 - Write a function in R to perform the linear regression. You are not allowed to use any linear regression specific functions or any package. Your function should take two inputs namely Y vector and the design matrix X. You need to apply your custom-built function on the following data:

n = 20

X1i = rnorm(n, 10, 2)

X2i = rbeta(n, 2, 3)

Y = -2 - 3*X1i + 4*X2i + rnorm(n)

Also, apply this function on the data data_for_problem_1.xlsx to predict PCB using THICKNESS. Perform the residual analysis to validate the working of your function.

Question 2 - Write a function from scratch which can perform the t-testing for any data (i.e. one-sample, two samples etc. ) in R. This function should mimic the base function t.test(). Use your function to perform t-testing on the following simulated data:

# simulate the data

xi1 = rnorm(20, 3, sqrt(9))

xi2 = 2*xi1

You are not allowed to use any R-package for these task.

Reference no: EM132583612

Questions Cloud

What are the prospects of futures contracts : What are the prospects of futures contracts as a significant risk management tool for firms? Discuss critically
Compute value for fields A : Assuming XA ~ N(200, 202) and XB ~ N(100, 402). Find the following: Compute P90A value for fields A defined as P[XA > P90A] = 0.9
Principles of finance and accounting to healthcare outcomes : Apply principles of finance and accounting to healthcare outcomes, reimbursements, and business operations.
Prepare financial budget : Prepare a financial budget that supports improved business and patient outcomes.
Write a function in R to perform the linear regression : Write a function in R to perform the linear regression. You are not allowed to use any linear regression specific functions or any package
Finance-economics in management of health systems : Compare and contrast the role of finance and economics in the management of health systems in the U.S. and international markets.
Calculate the harmonic mean of two numbers : Calculate the harmonic mean of two numbers x and y is using the expression and calculate and display their harmonic mean in dddd.dd format.
Develop population health plan : Develop a population health plan to address a health concern in the current healthcare industry.
Categorical-hierarchical and relational : Categorical: Comparing categories and distributions of quantities values, Hierarchical: Charting part-to-whole relationships and hierarchies

Reviews

Write a Review

Basic Statistics Questions & Answers

  Statistics-probability assignment

MATH1550H: Assignment:  Question:  A word is selected at random from the following poem of Persian poet and mathematician Omar Khayyam (1048-1131), translated by English poet Edward Fitzgerald (1808-1883). Find the expected value of the length of th..

  What is the least number

MATH1550H: Assignment:  Question:     what is the least number of applicants that should be interviewed so as to have at least 50% chance of finding one such secretary?

  Determine the value of k

MATH1550H: Assignment:  Question:     Experience shows that X, the number of customers entering a post office during any period of time t, is a random variable the probability mass function of which is of the form

  What is the probability

MATH1550H: Assignment:Questions: (Genetics) What is the probability that at most two of the offspring are aa?

  Binomial distributions

MATH1550H: Assignment:  Questions:  Let’s assume the department of Mathematics of Trent University has 11 faculty members. For i = 0; 1; 2; 3; find pi, the probability that i of them were born on Canada Day using the binomial distributions.

  Caselet on mcdonald’s vs. burger king - waiting time

Caselet on McDonald’s vs. Burger King - Waiting time

  Generate descriptive statistics

Generate descriptive statistics. Create a stem-and-leaf plot of the data and box plot of the data.

  Sampling variability and standard error

Problems on Sampling Variability and Standard Error and Confidence Intervals

  Estimate the population mean

Estimate the population mean

  Conduct a marketing experiment

Conduct a marketing experiment in which students are to taste one of two different brands of soft drink

  Find out the probability

Find out the probability

  Linear programming models

LINEAR PROGRAMMING MODELS

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd