STA 3100 Homework
Your cell phone bill varies from month to month. Suppose your year has the following monthly amounts:
46 33 39 37 46 30 48 32 49 35 30 48 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.
Create a vector of four 2s, then three 3s, then two 5s using the rep() function once. Next, create a vector where each of (1, 3, 5, 7, 9) is replaced by two repeats of itself using the rep() and seq() functions, first with the argument each, then with the argument times.
For a nonnegative integer k, k! can be computed using the command factorial(k). Print out the vector (1! 2! 3! 4! 5!) using the function factorial() once. Do this again using the function cumprod().
Let x = (1!, 2!, 3!, 4!, 5!) from Problem 3. Compute the sample mean and standard deviation of x using only the sum() and length() functions. Verify your results using the built-in mean and standard deviation functions.
Compute log xi (natural logarithm) and log3 xi for xi, i = 1, . . . , 5, where x = (1!, 2!, 3!, 4!, 5!). Also, verify the equality log (∏5i = 1 xi) = Σ5i=1 log xi.
Compute the geometric and harmonic means of x = (1!, 2!, 3!, 4!, 5!), where the sample mean is the arithmetic mean of x. Verify your results using the functions geometric.mean() and harmonic.mean() in the package psych. Is there an equality/inequality relating the three means?
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.
Business Economics Assignment 3: Case Study Analysis on Price Controls in Pharma and Monopoly Power in Airline Industry
Read MoreCSC408 MIS Case Study Assignment Report: Analysis of Issues and Solutions in Information Systems
Read MoreScientific Research Review Assignment 4: Advancements and Ethical Practices in Your Study Area Literature Synthesis
Read MoreOrganizational Development Assignment: Tech Solutions Inc. Case Study on Engagement, Retention, and Inclusive Culture
Read MoreHPGD3103 Instructional Technology Assignment: ASSURE Model-Based Lesson Design in Google Classroom
Read MoreAI Deepfake Cybersecurity Assignment: Evaluating Security Risks and Detection Techniques for Safe Digital Environments
Read MoreMGT4216E Strategic Innovation Management Assignment: Exploring Innovation Capabilities, Strategy Stages, and Leadership for Business Transformation
Read MoreEmployee Engagement & HR Strategy Assignment: Case Analysis of Tech Solutions Inc. on Turnover, D&I, Performance, and Work-Life Balance
Read MoreHigher Education Reform Assignment: Curriculum Development Strategies for a Future-Ready Malaysia
Read MoreCross-Cultural Management Assignment Report: Importance, Challenges & Strategies in Global Teams
Read More