Question

In: Computer Science

3. (Exercise 3.4) Use the Marriage data from the mosaicData package a) Create a bar plot...

3. (Exercise 3.4) Use the Marriage data from the mosaicData package a) Create a bar plot to show the frequency counts for each race b) Create a histogram to show the age distribution c) What distribution can you see for age? (Use comments to write in your R Markdown file) d) Create a time-series plot to show the delay by ceremony date (Note: you need to create a vector x<-1:98 first, and then create a new data frame with x=x and y=delay.)

Solutions

Expert Solution

install.packages("mosaic")#install library

library(mosaicData)#load library
attach(Marriage)#load data
barplot(table(race))#create barplot of race

hist(age)#create historam
#The distribution looks like normal distribution
#creating dataframe
x<-1:98
df=data.frame('x'<-x,'y'<-delay)
#plotting time series plot
plot.ts(df)


Related Solutions

Use the Galton dataset from the mosaicData package in R STUDIO library(mosaic) Create a scatter plot...
Use the Galton dataset from the mosaicData package in R STUDIO library(mosaic) Create a scatter plot to show the relationship between height against father’s height (x=father, y=height) What relationship did you see? (Use comments to write in your R Markdown file) Separate your plot into facets by sex Add a regression line using the “lm” method to both of your facets Generate a box plot of height by sex. Use the RailTrail data from the mosaicData package library(mosaic) Generate a...
Create a histogram of this data with 15 bins. Create a box plot of this data.
7, 9, 8, 11, 14, 7, 11, 17, 18, 12, 10, 9, 16, 17, 15, 13, 7, 12, 7, 8, 14, 16, 20, 12, 11, 14, 22, 8, 10, 14, 15, 20, 17, 14, 12, 22, 12, 15, 17, 16, 9, 11, 16, 18, 11, 12, 11, 9, 11, 9, 13, 7, 12, 9, 19, 9, 8, 15, 12, 16, 16, 20, 21, 9, 11, 17, 17, 8, 11, 7, 10, 17, 13, 15, 14, 11, 19,10, 11, 11, 9,...
Plot a Package Diagram for the Online Student Registration System. Use the Package Diagram class-based syntax.
Plot a Package Diagram for the Online Student Registration System. Use the Package Diagram class-based syntax.
To complete this exercise you need a software package that allows you to generate data from...
To complete this exercise you need a software package that allows you to generate data from the uniform and normal distributions. (i) Start by generating 500 observations xi - the explanatory variable - from the uniform distribution with range [0,10]. (Most statistical packages have a command for the Uniform[0,1] distribution; just multiply those observations by 10.) What are the sample mean and sample standard deviation of the xi? (ii) Randomly generate 500 errors, ui, from the Normal[0,36] distribution. (If you...
JAVA Exercise BasketBall Bar Chart Write a program that allows you to create a bar chart...
JAVA Exercise BasketBall Bar Chart Write a program that allows you to create a bar chart for the active members of a basketball team during a game. (Recall: there are only 5 active players on the court per team in a standard basketball game.) Your program should do the following tasks: • Prompt the user to store the first name of the five players • Prompt the user to enter the points scored by each player a. Use a while...
Use the data on lettuce yields in Exercise 2.2. Treatment (lb N/acre) Head of lecture/plot 0...
Use the data on lettuce yields in Exercise 2.2. Treatment (lb N/acre) Head of lecture/plot 0 104 114 90 140 50 134 130 144 174 100 146 142 152 156 150 147 160 160 163 200 131 148 154 163 Compute the analysis of variance for the dat Determine the best polynomial response function that describes the relationship between lettuce yield and nitrogen fertilizer at the .05 level of significance. Plot the observed means along with the estimated equation.
For this exercise, you will need to use the package `mosaic` to find numerical and graphical...
For this exercise, you will need to use the package `mosaic` to find numerical and graphical summaries. ```{r warning=FALSE, message=FALSE} # install packages if necessary if (!require(mosaic)) install.packages(`mosaic`) if (!require(dplyr)) install.packages(`dplyr`) if (!require(gapminder)) install.packages(`gapminder`) # load the package in R library(mosaic) # load the package mosaic to use its functions library(dplyr) # load the package dplyr to use its functions library(gapminder) # load the package gapminder for question 1 ``` 1. Using the gapminder data in the lesson, do the...
Construct a box plot from the given data. Use the approximation method. Scores on a Statistics...
Construct a box plot from the given data. Use the approximation method. Scores on a Statistics Test: 50,65,79,59,63,90,73,80,50,90
Construct a box plot from the given data. Use the approximation method. Diameters of Cans in...
Construct a box plot from the given data. Use the approximation method. Diameters of Cans in an Assembly Line: 5.7,5.2,5.7,5.6,5.1,5.3,5.5,5.3,5.6 Answer Draw the box plot by selecting each of the five movable parts to the appropriate position.
R Programming Exercise 3.4 From a normal distribution which has a standard deviation of 40 and...
R Programming Exercise 3.4 From a normal distribution which has a standard deviation of 40 and mean of 10, generate 2 to 600 samples. After generating the samples utilize the plot command to plot the mean of the generated sample (x-axis) against the number of samples (Y-axis). Use proper axis labels. Create a second plot of the density of the 600 samples that you generated. Use adequate comments to explain your reasoning. This code can be solved in 4 to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT