Question

Check the file: Questions.pdf

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

library(Lahman)
Salaries$salary <- as.numeric(Salaries$salary)
Salaries.AL <- Salaries[Salaries$lgID=="AL" & Salaries$yearID==2002,]
Salaries.NL <- Salaries[Salaries$lgID=="NL" & Salaries$yearID==2002,]
budgets.AL <- tapply(Salaries.AL$salary, Salaries.AL$teamID, sum, na.rm=T)
budgets.NL <- tapply(Salaries.NL$salary, Salaries.NL$teamID, sum, na.rm=T)
AL <- data.frame( budget=budgets.AL, team=names(budgets.AL) )
NL <- data.frame( budget=budgets.NL, team=names(budgets.NL))

budgets.AL <- budgets.AL[!is.na(budgets.AL)]
budgets.NL <- budgets.NL[!is.na(budgets.NL)]

budgets.AL <- c(budgets.AL, "League Average"=mean(budgets.AL))
budgets.NL <- c(budgets.NL, "League Average"=mean(budgets.NL))

budgets.AL <- sort(budgets.AL)
budgets.NL <- sort(budgets.NL)

# AL
par(mar=c(8,8,8,10))
r <- barplot(budgets.AL, horiz=T,width=c(rep(0.1,8),0.15,rep(0.1,6)),space=c(rep(40,8),60,60,rep(40,5)),col="skyblue",border="skyblue",las=1,axes=F,main="2002 Budgets of Teams in the American League",xlim=c(0,1.1*max(budgets.AL)))...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

R Programming Problems
Homework Solution
$78.00
Statistics
Mathematics
R Programming
ANOVA
Data Sets
Cancer Patients
Functions
Variance
Coefficients
Clusters
Molecules
Cell Differentiation
Genes
Cross Validation
Classification
Statistics Questions
Homework Solution
$43.00
Statistics
Mathematics
R Programming
Cluster Analysis
Golub Data
Patient Groups
Research
Cluster Means
Codes
Graphs
Distances
Gene Filters
Correlation Matrix
Outliers
Applied Statistics Questions
Homework Solution
$150.00
Applied Statistics
Mathematics
Profile Analysis
ND Data
Transformations
Treatment Effect
Probability
P-Value
Functions
Research
Hypothesis Tests on Data Frames
Homework Solution
$48.00
Mathematics
Statistics
Data
Libraries
Columns
Distribution
Histogram
R-Programming
Zyxin Gene
Expressions
Cancer Classification
Biostatistics Questions
Homework Solution
$35.00
Statistics
Biology
Mathematics
R Programming
Datasets
Independent Variables
Random Values
Alternative Hypothesis
Null Hypothesis
Population Parameters
Analysis
Results
Probability
P-Value
Degrees of Freedom
Test Statistic
Get help from a qualified tutor
Live Chats