R Homework Database Management and Modeling General exercises 1. Create a text vector called Months with names of the 12 months of the year. 2. Create a numeric vector Summer, with Calendar month...

the next 10 Questions- program at R


R Homework Database Management and Modeling General exercises 1. Create a text vector called Months with names of the 12 months of the year. 2. Create a numeric vector Summer, with Calendar month index positions for the summer months (inclusive, with 4 elements in all). 3. Use vector indexing to extract the text values of Months, indexed by Summer. 4. Multiply Summer by 3. What are the values of Months, when indexed by Summer multiplied by 3? Why do you get that answer? 5. What is the mean (average) summer month, as an integer value? Which value of Months corresponds to it? Why do you get that answer? 6. Use the floor() and ceiling() functions to return the upper and lower limits of Months for the average Summer month. (Hint: to find out how a function works, use R help if needed.) E-commerce Data for Exercises The data set comprises responses to intercept surveys asked when users visited the site, along with data about each user’s site activity such as number of pages visited and whether a sale was completed. Identifying details for the site and customers have been removed but the observations otherwise are actual data. We will load the data set first, and then explain a few of its observations. To load the data from CSV format, use the following command (or load ecommerce-data.csv from a local location if you have downloaded it, as noted in Section 1.6.3). ecomm.df <- read.csv("https://goo.gl/hzryfd") summary(ecomm.df) 1. how many observations and variables are in the e-commerce data set? 2. compute a frequency table for the country of origin for site visits. after the united states, which country had the most visitors? 3. compute a two-way frequency table for the intent to purchase (intentwasplanningtobuy), broken out by user profile. 4. what are the proportions of parents who intended to purchase? the proportions of teachers who did? for each one, omit observations for whom the intent is unknown (blank). 5. among us states (recorded in the variable region), which state had the most visitors and how many? 6. solve the previous problem for the state with the most visitors, using the which.max() function (or repeat the same answer, if you already used it). 7. draw a histogram for the number of visits to the site (behavnumvisits). adjust it for more detail in the lower values. color the bars and add a density line. 8. draw a horizontal boxplot for the number of site visits. 9. which chart from the previous two exercises, a histogram or a boxplot, is more useful to you, and why? 10. draw a boxplot for site visits broken out with a unique row for each profile type. (note: if the chart margins make it unreadable, try the following command before plotting: par(mar=c(3, 12, 2, 2)). after plotting, you can use the command par(mar=c(5, 4, 4, 2) + 0.1) to reset the chart margins.) 11. *write a function called meanmeddiff that returns the absolute difference between the mean and the median of a vector. 12. *what is the mean-median difference for number of site visits? 13. *what is the mean-median difference for site visits, after excluding the person who had the most visits? read.csv("https://goo.gl/hzryfd")="" summary(ecomm.df)="" 1.="" how="" many="" observations="" and="" variables="" are="" in="" the="" e-commerce="" data="" set?="" 2.="" compute="" a="" frequency="" table="" for="" the="" country="" of="" origin="" for="" site="" visits.="" after="" the="" united="" states,="" which="" country="" had="" the="" most="" visitors?="" 3.="" compute="" a="" two-way="" frequency="" table="" for="" the="" intent="" to="" purchase="" (intentwasplanningtobuy),="" broken="" out="" by="" user="" profile.="" 4.="" what="" are="" the="" proportions="" of="" parents="" who="" intended="" to="" purchase?="" the="" proportions="" of="" teachers="" who="" did?="" for="" each="" one,="" omit="" observations="" for="" whom="" the="" intent="" is="" unknown="" (blank).="" 5.="" among="" us="" states="" (recorded="" in="" the="" variable="" region),="" which="" state="" had="" the="" most="" visitors="" and="" how="" many?="" 6.="" solve="" the="" previous="" problem="" for="" the="" state="" with="" the="" most="" visitors,="" using="" the="" which.max()="" function="" (or="" repeat="" the="" same="" answer,="" if="" you="" already="" used="" it).="" 7.="" draw="" a="" histogram="" for="" the="" number="" of="" visits="" to="" the="" site="" (behavnumvisits).="" adjust="" it="" for="" more="" detail="" in="" the="" lower="" values.="" color="" the="" bars="" and="" add="" a="" density="" line.="" 8.="" draw="" a="" horizontal="" boxplot="" for="" the="" number="" of="" site="" visits.="" 9.="" which="" chart="" from="" the="" previous="" two="" exercises,="" a="" histogram="" or="" a="" boxplot,="" is="" more="" useful="" to="" you,="" and="" why?="" 10.="" draw="" a="" boxplot="" for="" site="" visits="" broken="" out="" with="" a="" unique="" row="" for="" each="" profile="" type.="" (note:="" if="" the="" chart="" margins="" make="" it="" unreadable,="" try="" the="" following="" command="" before="" plotting:="" par(mar="c(3," 12,="" 2,="" 2)).="" after="" plotting,="" you="" can="" use="" the="" command="" par(mar="c(5," 4,="" 4,="" 2)="" +="" 0.1)="" to="" reset="" the="" chart="" margins.)="" 11.="" *write="" a="" function="" called="" meanmeddiff="" that="" returns="" the="" absolute="" difference="" between="" the="" mean="" and="" the="" median="" of="" a="" vector.="" 12.="" *what="" is="" the="" mean-median="" difference="" for="" number="" of="" site="" visits?="" 13.="" *what="" is="" the="" mean-median="" difference="" for="" site="" visits,="" after="" excluding="" the="" person="" who="" had="" the="" most="">
Apr 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here