Calculate the median profit for the companies

Assignment Help Programming Languages
Reference no: EM132367453

Assignment

Answer all questions specified on the problem and include a discussion on how your results an- swered/addressed the question.

Please do the following problems from the text book R Handbook and stated.

1. Question 1.1, pg. 23 in Handbook this question will require you to make some assumptions. List your assumptions and how you interpreted the question.

Ex. 1.1 Calculate the median profit for the companies in the US and the median profit for the companies in the UK; France, and Germany.

2. Question 1.2,

Ex. 1.2 Find all German companies with negative profit.

3. Question 1.3,

Ex. 1.3 'lb which business category do most of the Bermuda island companies belong?

4. Question 1.4,

Ex. 1.4 For the 50 companies in the Forbes data set with the highest profits, plot sales against assets (or some suitable transformation of each variable), labeling each point with the appropriate country name which may need to be abbreviated (using abbreviate) to avoid making the plot look too 'messy'.

5. Question 1.5,

Ex. 1.5 Find the average value of sales for the companies in each country in the Forbes data set, and find the number of companies in each country with profits above 5 billion US dollars.

6. Question 2.1,

Ex. 2.1 The data in Table 2.3 are part of a data set collected from a survey of household expenditure and give the expenditure of 20 single men and 20 single women on four commodity groups. The units of expenditure are Hong Kong dollars, and the four commodity groups are housing housing, including fuel and light, food foodstuffs, including alcohol and tobacco, goods other goods, including clothing, footwear, and durable goods, service services, including transport and vehicles.

The aim of the survey was to investigate how the division of household expenditure between the four commodity groups depends on total expen¬diture and to find out whether this relationship differs for men and women. Use appropriate graphical methods to answer these questions and state your conclusions.

Table 2.3: household data. Household expenditure for single men and women.

housing

food

goods

service

gender

820

114

183

154

female

184

74

6

20

female

921

66

1686

455

female

488

80

103

115

female

721

83

176

104

female

614

55

441

193

female

.801

56

357

214

female

396

59

61

80

female

864

65

1618

352

female

845

64

1935

414

female

404

97

33

47

female

7.Question 2.3,

Ex. 2.3 Mortality rates per 100,000 from male suicides for a number of age groups and a number of countries are given in Table 2.5. Construct side¬by-side box plots for the data from different age groups, and comment on what the graphic tells us about the data.

Table 2.5: suicides2 data. Mortality rates per 100,000 from male suicides.

 

A25.34

A35.44

A45.54

A55.64

A65.74

Canada

22

27

31

34

24

Israel

9

19

10

14

27

Japan

22

19

21

31

49

Austria

29

40

52

53

69

France

16

25

36

47

56

Germany

28

35

41

49

52

Hungary

48

65

84

81

107

Italy

7

8

11

18

27

Netherlands

8

11

18

20

28

Poland

26

29

36

32

28

Spain

4

7

10

16

22

Sweden

28

41

46

51

35

Switzerland

22

34

41

50

51

UK

10

13

15

17

22

USA

20

22

28

33

37

8. Using a single R expression, calculate the median absolute deviation, 1.4826 median |x-µ|, where µ is the sample median. Use the dataset chickwts. Use the R function mad() to verify your answer.

9. Using the data matrix state.x77, find the state with the minimum per capita income in the New England region as defined by the factor state.division. Use the vector state.name to get the state name.

10. Use subscripting operations on the dataset Cars93 to find the vehicles with highway mileage of less than 25 miles per gallon (variable MPG.highway) and weight (variable Weight) over 3500lbs. Print the model name, the price range (low, high), highway mileage, and the weight of the cars that satisfy these conditions.

11. Form a matrix object named mycars from the variables Min.Price, Max.Price, MPG.city, MPG.highway, EngineSize, Length, Weight from the Cars93 dataframe from the MASS package. Use it to create a list object named cars.stats containing named components as follows:

a)A vector of means, named Cars.Means

b)A vector of standard errors of the means, named Cars.Std.Errors

12. Use the apply() function on the three-dimensional array iris3 to compute:

a) Sample means of the variables Sepal Length, Sepal Width, Petal Length, Petal Width, for each of the three species Setosa, Versicolor, Virginica

b) Sample means of the variables Sepal Length, Sepal Width, Petal Width for the entire data set.

13. Use the data matrix state.x77 and the tapply() function to obtain:

a) The mean per capita income of the states in each of the four regions defined by the factor state.region

b) The maximum illiteracy rates for states in each of the nine divisions defined by the factor state.division

c) The number of states in each region

14. Using the dataframe mtcars, produce a scatter plot matrix of the variables mpg, disp, hp, drat, qsec. Use different colors to identify cars belonging to each of the categories defined by the carsize variable in different colors.

carsize = cut (mtcars[,"wt"], breaks= c(0,2.5,3.5,5.5),
+ labels = c("Compact","Midsize","Large"))

15. Use the function aov() to perform a one-way analysis of variance on the chickwts data with feed as the treatment factor. Assign the result to an object named chick.aov and use it to print an ANOVA table.

16. Write an R function named ttest() for conducting a one-sample t-test. Return a list object containing the two components:

• the t-statistic named T;

• the two-sided p-value named P.

Use this function to test the hypothesis that the mean of the weight variable (in the chickwts dataset) is equal to 240 against the two-sided alternative. For this problem, please show the code of function you created as well as show the output.

Reference no: EM132367453

Questions Cloud

What is the mean difference : The mean of the male students is 2.59 and the standard deviation is .76. What is the mean difference?
What is the probability of obtaining x for a given : (i) What is the probability of obtaining x for a given y? (i) Determine the Maximum Likelihood estimate hML of y.
Determine how to apply the first basic step in a statistical : Determine how to apply the first basic step in a statistical study in this situation. Choose the correct answer below.
How many would you expect to name chocolate : In a recent study 35% of people surveyed indicate chocolate was their favorite flavor ice cream. Suppose we select a sample of ten and ask them to name
Calculate the median profit for the companies : STAT 601-Calculate the median profit for the companies in the US and the median profit for the companies in the UK; France, and Germany.
Upper limit for each of the two control charts : What should be the lower limit, center line and the upper limit for each of the two control charts?
Nature of statistical thinking and intelligent decision : Explain the relationship between the nature of statistical thinking and intelligent decision?
What is the probability that 9 or more are serving time : What is the probability that 9 or more are serving time for drug dealing? (Round your answer to three decimal places.)
Find the area under the standard normal distribution : Find the area under the standard normal distribution to the left of z = -1.05. Round answer to 4 decimal places.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to swap values from variables

Given two int variables, firstPlaceWinner and secondPlaceWinner , write some code that swaps their values. Declare any additional variables as necessary.

  Find out the total of balances

Display all the contents of the file in a tabular format with the first row being a header row and write to a file that is called account numbers.txt only the account numbers from the read file.

  Hru access control matrix model

How will the matrix above result if we execute the command and Write a command delete_object(sub1,sub1) that will delete any occurrences of sub1 if sub1has the right m with itself

  Write css rule to gives all h elements padding

Write down CSS rule which gives all h1 and h2 elements padding of 0.5 ems, grooved border style and margin of 0.5ems. Prepare a layout template which contains header and two columns.

  Program creates the basic user interface code

Scenario and SummaryThis program creates the basic user interface code that can be used in the following week's iLab assignments. The assignment will help you get started using the programming environment and some practice with coding. You will al..

  Describe issues-web site designers when adding multimedia

Describe some of the issues web site designers must consider when adding multimedia to a web site. Consider issues such as bandwidth, server load, or others you consider to be important. Please provide references.

  What are the differences between scripting and programming

What are the differences between scripting and programming? Are there any features or power differences between scripting and programming languages?

  My goal is to write down a php database application with a

my goal is to write a php database application with a gui that will display and update information on a remote database

  List all other use cases at comparable level of abstraction

One use case is to make a flight reservation. List all other use cases at a comparable level of abstraction. Summarize the purpose of each use case with a sentence.

  Determines how much weight a person can gain

CSE 1321L: Programming and Problem Solving I Lab - Assignment - Pseudocode Algorithms - What do we mean by this? As an example, we could ask you how many shades

  Create a simple command line program

Create a simple command line program that simulates the rolling of a pair of six sided dice a user given number of times. The number of times to roll the pair of dice should be read as input from the argv array on the command line.

  Compare and contrast database connectivity in vb and c#

Compare and contrast database connectivity in VB® and C#. If you studied database connectivity in Java®, include Java® in the comparison. In which language do you find it easiest to implement a connection to a database? Why

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd