Submit the following two files to the relevant dropbox on course website. 1. One single pdf...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Submit the following two files to the relevant dropbox on course website. 1. One single pdf file of your report. This file should be named HWx_Last.pdf, where x is the homework number and Last is your last name (e.g., HW1_Lee.pdf). Show your steps, code, and output in your report so that the grader can see your work without actually running your code. You do not need to explain your code line by line, but you should provide enough details so that the grader can understand the flow of your code. 2. One single R file of your code. This file should be named HWx_Last.R, where x and Last are the same as before. This file is to allow the grader to verify your work if necessary. The grader should be able to run your code without modification except (possibly) changing the paths that you use for filenames, etc. In summary, your report should stand alone! • You are not allowed to use any non-Base R package unless otherwise spec- ified. • Do not use R comments to answer a theoretical question. Handwrite or type your answer clearly with appropriate statistical notations. For example, do not write something like . # H1: mu != mu0; # p-value is pnorm (zstar). Instead, handwrite or type • H₁: μμo; . • p-value is P(Z < z*), with all symbols defined clearly. • Problems should appear in the order that they were assigned. . # p-value is pnorm (zstar). Instead, handwrite or type Page 1 1 of 3 • Η: μ # μο; • p-value is P(Z < z*), with all symbols defined clearly. • Problems should appear in the order that they were assigned. • Failing to follow the instructions above may result in a deduction of 50% or more credit. Assignment: 1. Your cell phone bill varies from month to month. Suppose your year has the following monthly amounts ZOOM + 46 33 39 37 46 30 48 32 49 35 30 48 Page 2 of 3 Explore the function scan () and use it to read the data. How much did you spend this year on the cell phone? What is the smallest amount you spent in a month? What is the largest? How many months was the amount greater than 40? What percentage was this? Answer all questions using R. 2. Using the rep() function once, create a vector of four 2s, then three 3s, then two 5s. Next, using the rep() and seq() functions, create a vector where each of (1,3,5,7,9) is replaced by two repeats of itself. First do this with the argument each, then with the argument times. 3. For a nonnegative integer k, k! can be computed using the command factorial (k). Using the function factorial () once, print out the vector (1, 2, 3, 4, 5!). Do this again using the function cumprod(). 4. Let x = (1, 2, 3, 4, 5!) from Problem B. Compute the sample mean and standard deviation of using only the sum () and length() functions. Verify your results using the built-in mean and standard deviation functions. 5. Let x₁, i = 1,..., 5, be the ith element of x = (1, 2, 3, 4, 5!). Compute log x; (i.e., the natural logarithm) and log3.₁. Also, verify the equality log (I-1) = Ei=1 log.x₁. 6. For observations y₁, i = 1,..., n, the arithmetic mean is defined as A = n=¹ [₁1 Yi; the geometric mean is defined as JG = (IT-19); the harmonic mean is defined as 1/n. JH = n(1₁¹)¹. The sample mean of x = (1!, 2!, 3!, 4!, 5!) computed in Problem is in fact the arithmetic mean of x. Here, compute the geometric and harmonic means of r. Verify your results using the functions geometric.mean() and harmonic.mean() in the package psych. Is there an equality/inequality relating the three means? 7. Assign the vector (2,8, 3, 7, 4, 1,9) to an object. Using one single command, find the elements of the vector that are even or greater than 7, multiply those elements by -1 and use them to replace the original elements. Print out the new vector. (Hint: You may find the %% operator useful. Explore it using the command ?"%%".) ZOOM + 46 33 39 37 46 30 48 32 49 35 30 48 Page 2 of 3 Explore the function scan () and use it to read the data. How much did you spend this year on the cell phone? What is the smallest amount you spent in a month? What is the largest? How many months was the amount greater than 40? What percentage was this? Answer all questions using R. 2. Using the rep() function once, create a vector of four 2s, then three 3s, then two 5s. Next, using the rep() and seq() functions, create a vector where each of (1,3,5,7,9) is replaced by two repeats of itself. First do this with the argument each, then with the argument times. 3. For a nonnegative integer k, k! can be computed using the command factorial (k). Using the function factorial () once, print out the vector (1, 2, 3, 4, 5!). Do this again using the function cumprod(). 4. Let x = (1, 2, 3, 4, 5!) from Problem B. Compute the sample mean and standard deviation of using only the sum () and length() functions. Verify your results using the built-in mean and standard deviation functions. 5. Let x₁, i = 1,..., 5, be the ith element of x = (1, 2, 3, 4, 5!). Compute log x; (i.e., the natural logarithm) and logg i. Also, verify the equality log (1) = Ei log.x₁. 6. For observations y₁, i = 1,..., n, the arithmetic mean is defined as A = n=¹ [₁1 Yi; the geometric mean is defined as JG = (IT-19); the harmonic mean is defined as 1/n. JH = n(1₁¹)¹. The sample mean of x = (1!, 2!, 3!, 4!, 5!) computed in Problem is in fact the arithmetic mean of x. Here, compute the geometric and harmonic means of r. Verify your results using the functions geometric.mean() and harmonic.mean() in the package psych. Is there an equality/inequality relating the three means? 7. Assign the vector (2,8, 3, 7, 4, 1,9) to an object. Using one single command, find the elements of the vector that are even or greater than 7, multiply those elements by -1 and use them to replace the original elements. Print out the new vector. (Hint: You may find the %% operator useful. Explore it using the command ?"%%".) ZOOM + Page < of 3 8. Explore the functions LETTERS () and letters (). Using the paste() function, print out the following. [1] "Dd is the 4th letter of the English alphabet" [2] "Ee is the 5th letter of the English alphabet" [3] "Ff is the 6th letter of the English alphabet" [4] "Gg is the 7th letter of the English alphabet" 2 3 [5] "Hh is the 8th letter of the English alphabet" [6] "Ii is the 9th letter of the English alphabet" [7] "Jj is the 10th letter of the English alphabet" [8] "Kk is the 11th letter of the English alphabet" [9] "L1 is the 12th letter of the English alphabet" [10] "Mm is the 13th letter of the English alphabet" [11] "Nn is the 14th letter of the English alphabet" [12] "Oo is the 15th letter of the English alphabet" [13] "Pp is the 16th letter of the English alphabet" [14] "Qq is the 17th letter of the English alphabet" [15] "Rr is the 18th letter of the English alphabet" [16] "Ss is the 19th letter of the English alphabet" ZOOM + [17] "Tt is the 20th letter of the English alphabet [18] "xx in the 24th letter of the English alphabet [19] "Yy is the 25th letter of the English alphabet (20) "2z in the 26th letter of the English alphabet Submit the following two files to the relevant dropbox on course website. 1. One single pdf file of your report. This file should be named HWx_Last.pdf, where x is the homework number and Last is your last name (e.g., HW1_Lee.pdf). Show your steps, code, and output in your report so that the grader can see your work without actually running your code. You do not need to explain your code line by line, but you should provide enough details so that the grader can understand the flow of your code. 2. One single R file of your code. This file should be named HWx_Last.R, where x and Last are the same as before. This file is to allow the grader to verify your work if necessary. The grader should be able to run your code without modification except (possibly) changing the paths that you use for filenames, etc. In summary, your report should stand alone! • You are not allowed to use any non-Base R package unless otherwise spec- ified. • Do not use R comments to answer a theoretical question. Handwrite or type your answer clearly with appropriate statistical notations. For example, do not write something like . # H1: mu != mu0; # p-value is pnorm (zstar). Instead, handwrite or type • H₁: μμo; . • p-value is P(Z < z*), with all symbols defined clearly. • Problems should appear in the order that they were assigned. . # p-value is pnorm (zstar). Instead, handwrite or type Page 1 1 of 3 • Η: μ # μο; • p-value is P(Z < z*), with all symbols defined clearly. • Problems should appear in the order that they were assigned. • Failing to follow the instructions above may result in a deduction of 50% or more credit. Assignment: 1. Your cell phone bill varies from month to month. Suppose your year has the following monthly amounts ZOOM + 46 33 39 37 46 30 48 32 49 35 30 48 Page 2 of 3 Explore the function scan () and use it to read the data. How much did you spend this year on the cell phone? What is the smallest amount you spent in a month? What is the largest? How many months was the amount greater than 40? What percentage was this? Answer all questions using R. 2. Using the rep() function once, create a vector of four 2s, then three 3s, then two 5s. Next, using the rep() and seq() functions, create a vector where each of (1,3,5,7,9) is replaced by two repeats of itself. First do this with the argument each, then with the argument times. 3. For a nonnegative integer k, k! can be computed using the command factorial (k). Using the function factorial () once, print out the vector (1, 2, 3, 4, 5!). Do this again using the function cumprod(). 4. Let x = (1, 2, 3, 4, 5!) from Problem B. Compute the sample mean and standard deviation of using only the sum () and length() functions. Verify your results using the built-in mean and standard deviation functions. 5. Let x₁, i = 1,..., 5, be the ith element of x = (1, 2, 3, 4, 5!). Compute log x; (i.e., the natural logarithm) and log3.₁. Also, verify the equality log (I-1) = Ei=1 log.x₁. 6. For observations y₁, i = 1,..., n, the arithmetic mean is defined as A = n=¹ [₁1 Yi; the geometric mean is defined as JG = (IT-19); the harmonic mean is defined as 1/n. JH = n(1₁¹)¹. The sample mean of x = (1!, 2!, 3!, 4!, 5!) computed in Problem is in fact the arithmetic mean of x. Here, compute the geometric and harmonic means of r. Verify your results using the functions geometric.mean() and harmonic.mean() in the package psych. Is there an equality/inequality relating the three means? 7. Assign the vector (2,8, 3, 7, 4, 1,9) to an object. Using one single command, find the elements of the vector that are even or greater than 7, multiply those elements by -1 and use them to replace the original elements. Print out the new vector. (Hint: You may find the %% operator useful. Explore it using the command ?"%%".) ZOOM + 46 33 39 37 46 30 48 32 49 35 30 48 Page 2 of 3 Explore the function scan () and use it to read the data. How much did you spend this year on the cell phone? What is the smallest amount you spent in a month? What is the largest? How many months was the amount greater than 40? What percentage was this? Answer all questions using R. 2. Using the rep() function once, create a vector of four 2s, then three 3s, then two 5s. Next, using the rep() and seq() functions, create a vector where each of (1,3,5,7,9) is replaced by two repeats of itself. First do this with the argument each, then with the argument times. 3. For a nonnegative integer k, k! can be computed using the command factorial (k). Using the function factorial () once, print out the vector (1, 2, 3, 4, 5!). Do this again using the function cumprod(). 4. Let x = (1, 2, 3, 4, 5!) from Problem B. Compute the sample mean and standard deviation of using only the sum () and length() functions. Verify your results using the built-in mean and standard deviation functions. 5. Let x₁, i = 1,..., 5, be the ith element of x = (1, 2, 3, 4, 5!). Compute log x; (i.e., the natural logarithm) and logg i. Also, verify the equality log (1) = Ei log.x₁. 6. For observations y₁, i = 1,..., n, the arithmetic mean is defined as A = n=¹ [₁1 Yi; the geometric mean is defined as JG = (IT-19); the harmonic mean is defined as 1/n. JH = n(1₁¹)¹. The sample mean of x = (1!, 2!, 3!, 4!, 5!) computed in Problem is in fact the arithmetic mean of x. Here, compute the geometric and harmonic means of r. Verify your results using the functions geometric.mean() and harmonic.mean() in the package psych. Is there an equality/inequality relating the three means? 7. Assign the vector (2,8, 3, 7, 4, 1,9) to an object. Using one single command, find the elements of the vector that are even or greater than 7, multiply those elements by -1 and use them to replace the original elements. Print out the new vector. (Hint: You may find the %% operator useful. Explore it using the command ?"%%".) ZOOM + Page < of 3 8. Explore the functions LETTERS () and letters (). Using the paste() function, print out the following. [1] "Dd is the 4th letter of the English alphabet" [2] "Ee is the 5th letter of the English alphabet" [3] "Ff is the 6th letter of the English alphabet" [4] "Gg is the 7th letter of the English alphabet" 2 3 [5] "Hh is the 8th letter of the English alphabet" [6] "Ii is the 9th letter of the English alphabet" [7] "Jj is the 10th letter of the English alphabet" [8] "Kk is the 11th letter of the English alphabet" [9] "L1 is the 12th letter of the English alphabet" [10] "Mm is the 13th letter of the English alphabet" [11] "Nn is the 14th letter of the English alphabet" [12] "Oo is the 15th letter of the English alphabet" [13] "Pp is the 16th letter of the English alphabet" [14] "Qq is the 17th letter of the English alphabet" [15] "Rr is the 18th letter of the English alphabet" [16] "Ss is the 19th letter of the English alphabet" ZOOM + [17] "Tt is the 20th letter of the English alphabet [18] "xx in the 24th letter of the English alphabet [19] "Yy is the 25th letter of the English alphabet (20) "2z in the 26th letter of the English alphabet
Expert Answer:
Answer rating: 100% (QA)
Let 1 true average wear of brandA 2 true average wear of brandB null hy... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A teapot with a brewer at the top is used to brew tea, as shown in Fig. P3-143. The brewer may partially block the vapor from escaping, causing the pressure in the teapot to rise and an overflow from...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Let x be the number of magazines a person reads every week. Based on a sample survey of adults, the following probability distribution table was prepared. Find the mean and standard deviation of x. 0...
-
Describe some of the similarities between U.S. and international standard-setting structures.
-
The records for the Clothing Department of Sharapova's Discount Store are summarized below for the month of January. Inventory, January 1: at retail $25,000; at cost $17,000 Purchases in January: at...
-
prototype is an early sample, model, or release of a product that is built to test a concept or a process. The idea is to show the sample or model to potential users and then use their feedback to...
-
Labor costs of an auto repair mechanic are seldom based on actual hours worked. Instead, the amount paid a mechanic is based on an industry average of time estimated to complete a repair job. The...
-
(a) (b) In a liberalised economy, market forces of demand and supply dictate the interest rates and exchange rates in the market. With reference to the above statement, analyse two justifications why...
-
The production manager at a factory manufacturing four types of light fittings (A, B, C and D) on an automated machine is fixing the schedule for the next week on this machine. HEIJUNKA SCHEDULING OF...
-
The owner of an auto dealership has the following data set containing information about the vehicles on his small lot: Vehicle Identification Number Vehicle Type Year Gas Mileage (in miles per...
-
The two major types of facilities are distribution sites and storage sites. production sites and distribution sites. production sites and storage sites. retail sites and distribution sites.
-
The data and analysis concerning facilities, inventory, transportation, and customers throughout the supply chain is known as facilities. inventory. transportation. information.
-
A department store has purchased 5,000 swimsuits to be sold during the summer sales season. The season lasts three months, and the store manager forecasts that customers buying early in the season...
-
Describe the role of cycle inventory in a supply chain.
-
All raw materials, work in process, and finished goods within a supply chain are known as inventory. facilities. transportation. information.
-
Silicon at T-300K is uniformly doped with Boron atoms to a concentration of 5x10 cm and with Arsenic atoms to a concentration of 2x10 cm. a) Is the semiconductor a type or p type? Calculate the...
-
White Bolder Investments (WBI) You are an intern working for WBI, a large investment advisory services in Sydney. Among other regular customers, WBI has been providing advisory services for Jumbo...
-
Larry and Lisa Williams, both 33 years old, have been married for 9 years. They live at 638 Arctic Way, Fairbanks, AK 99701. Lisa's Social Security number is 445- 81-1423 and Larry's is 798-09-8526....
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
Indicate, in each of the following situations, the number of exemptions the taxpayers are entitled to claim on their 2012 income tax returns. Number of Exemptions a. Donna, a 20-year-old single...
-
Why will a projectile that moves horizontally at 8 km/s follow a curve that matches the curvature of Earth?
-
How does the brightness of light on a surface change when a point source of light is brought twice as far away?
-
Is it correct to say that the planets of the solar system are simply projectiles falling around the Sun?
Study smarter with the SolutionInn App