Questions
Please use R "Team","WINS","HR","BA","ERA" "Anaheim Angels",99,152,.282,3.69 "Baltimore Orioles",67,165,.246,4.46 "Boston Red Sox",93,177,.277,3.75 "Chicago White Sox",81,217,.268,4.53 "Cleveland Indians",74,192,.249,4.91...

Please use R

"Team","WINS","HR","BA","ERA"

"Anaheim Angels",99,152,.282,3.69

"Baltimore Orioles",67,165,.246,4.46

"Boston Red Sox",93,177,.277,3.75

"Chicago White Sox",81,217,.268,4.53

"Cleveland Indians",74,192,.249,4.91

"Detroit Tigers",55,124,.248,4.93

"Kansas City Royals",62,140,.256,5.21

"Minnesota Twins",94,167,.272,4.12

"New York Yankees",103,223,.275,3.87

"Oakland Athletics",103,205,.261,3.68

"Seattle Mariners",93,152,.275,4.07

"Tampa Bay Devil Rays",55,133,.253,5.29

"Texas Rangers",72,230,.269,5.15

"Toronto Blue Jays",78,187,.261,4.8

"Arizona Diamondbacks",98,165,.267,3.92

"Atlanta Braves",101,164,.26,3.13

"Chicago Cubs",67,200,.246,4.29

"Cincinnati Reds",78,169,.253,4.27

"Colorado Rockies",73,152,.274,5.2

"Florida Marlins",79,146,.261,4.36

"Houston Astros",84,167,.262,4

"Los Angeles Dodgers",92,155,.264,3.69

"Milwaukee Brewers",56,139,.253,4.73

"Montreal Expos",83,162,.261,3.97

"New York Mets",75,160,.256,3.89

"Philadelphia Phillies",80,165,.259,4.17

"Pittsburgh Pirates",72,142,.244,4.23

"St. Louis Cardinales",97,175,.268,3.7

"San Diego Padres",66,136,.253,4.62

"San Francisco Giants",95,198,.267,3.54

data on the following variables for the 30 major league baseball teams during the 2002 season: • WINS: number of games won • HR: number of home runs hit • BA: average batting average • ERA: earned run average

(a) Using WINS as the dependent variable, run the regression relating the three predictor variables to WINS. Report the fitted regression line.

(b) Construct the ANOVA table of the above model.

(c) Plot the residuals ei against the fitted values ybi . What departures from the regression model assumptions can be studied from this plot? What are your findings? (Note: If you are not sure about the validity of any of the assumptions, perform a formal test to verify your answer.) 1

(d) Prepare a normal probability plot (QQ plot) of the residuals. Which assumption can be tested from this plot and what do you conclude? (Note: You can also use the formal test to reinforce your conclusion).

(e) If there is no problem with any of the assumptions, you can safely continue on making inference. Test for the significance of the regression using a 0.05 significance level.

(f) What percentage of the variability in y is explained by the regression?

(g) Using the individual t-tests, comment on the significance of each predictor variable, using a 0.05 significance level.

Hint: data=read.table(‘hmw6_prob2.txt’, header=T, sep=‘,’) y=data$WINS x1=data$HR x2=data$BA x3=data$ERA

In: Statistics and Probability

Create a java program. War is a card game for two players. A standard deck of...

Create a java program.

  • War is a card game for two players.
  • A standard deck of 52 cards is dealt so that both players have 26 cards.
  • During each round of play (or "battle"), both players play a card from the top of their hand face up.
  • The player who plays the card of the higher rank wins both cards and places them at the bottom of his stack of cards.
  • If both cards played are of the same rank, then we have a WAR! Both players play three additional cards face down and then one more card face up.
  • The player who wins the war by playing the higher card wins all ten cards.
  • If the ranks are still the same, additional wars are played until one player wins the turn.
  • If either player runs out of cards to play, he loses the game.

Sample output might look like this:

player 1 plays Card is 9 of Clubs

player 2 plays Card is Ace of Diamonds

player 2 wins the round

player 1 plays Card is 10 of Diamonds

player 2 plays Card is Ace of Hearts

player 2 wins the round

player 1 plays Card is 7 of Clubs

player 2 plays Card is 6 of Hearts

player 1 wins the round

player 1 plays Card is 9 of Hearts

player 2 plays Card is 9 of Clubs

WAR TIME!

war card for player1 Card is xx

war card for player2 Card is xx

war card for player1 Card is xx

war card for player2 Card is xx

war card for player1 Card is xx

war card for player2 Card is xx

war card for player1 Card is 7 of Clubs

war card for player2 Card is 10 of Diamonds

player 2 wins the war round

player 1 plays Card is 6 of Hearts

player 2 plays Card is Ace of Hearts

player 2 wins the round

game over

player 2 wins the game


You already have a Deck Class and a Card Class. You can reuse them. However, you must make some changes and additions:

  • You must use enum for your ranks and suits
  • You must create a new class for a hand – each player has a hand that has a variable number of cards. Is a hand like a deck? Is there a possibility for inheritance? Or is it best to create a new class?

Your menu should look like this:

  1. Create new deck
  2. Shuffle deck
  3. Show deck
  4. Play War
  5. Exit

When option 4 is selected, you will start the War game. The program will ask the user for the maximum battle number. This will allow the game to stop in case it goes on too long. This will be in integer. Then next thing you will do is deal 26 cards to player 1 and 26 cards to player 2. Then you will show all the cards for each player. Then you will pause and ask the user to press any key to continue.

The game of war will play out as described above. Each time the players compare a card, it is called a battle. If the Max Battle Number is reached – the game stops and both players show all of their cards. If one player collects all the cards before the Max Battle Number is reached, then that player is declared the winner and the program asks the user to press any key to continue. Then the program returns to the main menu.

In: Computer Science

The game of roulette is popular in many casinos around the world. In Las Vegas, a...

The game of roulette is popular in many casinos around the world. In Las Vegas, a typical roulette wheel has the numbers 1–36 in slots on the wheel. Half of these slots are red, and the other half are black. In the United States, the roulette wheel typically also has the numbers 0 (zero) and 00 (double zero), and both of these are on the wheel in green slots. Thus, there are 38 slots on the wheel. The dealer spins the wheel and sends a small ball in the opposite direction of the spinning wheel. As the wheel slows, the ball falls into one of the slots, and that is the winning number and color. One of the bets available is simply red or black, for which the odds are 1 to 1. If the player bets on either red or black, and that happens to be the winning color, the player wins the amount of her bet. For example, if the player bets $5 on red and wins, she is paid $5 and she still has her original bet. On the other hand, if the winning color is black or green when the player bets red, the player loses the entire bet.

(a) What is the probability that a player who bets red will win the bet?

(b) If a player bets $10 on red every time the game is played, what is the expected monetary value (expected win)?

(c) In Europe, there is usually no 00 on the wheel, just the 0. With this type of game, what is the probability that a player who bets red will win the bet? If a player bets $10 on red every time in this game (with no 00), what is the expected monetary value?

(d) Since the expected profit (win) in a roulette game is negative, why would a rational person play the game?

In: Statistics and Probability

One of the harmonic frequencies of tube A with two open ends is 836 Hz. The...

One of the harmonic frequencies of tube A with two open ends is 836 Hz. The next-highest harmonic frequency is 912 Hz. (a) What harmonic frequency is next highest after the harmonic frequency 228 Hz? (b) What is the number of this next-highest harmonic? One of the harmonic frequencies of tube B with only one open end is 2940 Hz. The next-highest harmonic frequency is 3220 Hz. (c) What harmonic frequency is next highest after the harmonic frequency 3780 Hz? (d) What is the number of this next-highest harmonic?

In: Physics

Method calling in c# I need to write methods for calling the min and max numbers...

Method calling in c#

I need to write methods for calling the min and max numbers using this code;

Console.WriteLine("Calling highest method.");
Console.WriteLine("Highest number is: {0}", highest(3));
Console.WriteLine("Calling lowest method.");
Console.WriteLine("Lowest number is: {0}", lowest(3));

In: Computer Science

An insulated tank containing 0.5m3 of R-134 at 500 kPa and 90% quality is connected to...

An insulated tank containing 0.5m3 of R-134 at 500 kPa and 90% quality is connected to an initially evacuated insulated piston-cylinder device. The force balance on the piston is such that a pressure of 120kPa is required to lift the piston. The valve is then opened slightly and part of the refrigerant flows to the cylinder, pushing the piston up and the final cylinder volume is 1.5 m 3 . The process ends when the pressure in the tank drops to 120kPa. Assume the refrigerant in the tank undergoes an isentropic process. (a) Determine the quality in the tank and the cylinder. 0.896, 0.92 (b) Calculate the boundary work 280.8 kJ (Expansion) (c) Determine the entropy generated during the process 0.1973 kJ/K

In: Mechanical Engineering

A 2.25×104 N elevator is to be accelerated upward by connecting it to a counterweight using...

A 2.25×104 N elevator is to be accelerated upward by connecting it to a counterweight using a light (but strong!) cable passing over a solid uniform disk-shaped pulley. There is no appreciable friction at the axle of the pulley, but its mass is 875 kg and it is 1.50 m in diameter.

How heavy should the counterweight be so that it will accelerate the elevator upward through 6.00 m in the first 4.00 s , starting from rest?

Under these conditions, what is the tension in the cable on elevator side of the pulley?

Under these conditions, what is the tension in the cable on counterweight side of the pulley?

I posted this before but 3000 wasnt the correct answer

In: Physics

In her paper titled “Choking under pressure of top performers: Evidence from biathlon competitions”, Florian Lindner...

In her paper titled “Choking under pressure of top performers: Evidence from biathlon competitions”, Florian Lindner looks at the effect of pressure on performance in Biathlon World Cup competitions. Her main regression involves regressing the variable ‘missed fifth shot’ which is a dummy variable equal to 1 if the shot was unsuccessful and 0 if the shot was successful (missing the decisive fifth shot is defined as choking under pressure) on several variables that include:

‘lane’-This variable serves as a proxy for relative performance, i.e., the rank at the beginning of the final shooting bout (the fastest competitors and those with the highest probability to finish in the top positions occupy shooting lanes with lower numbers). But this variable is normalized from 0 to 1 so that 0 corresponds to the highest lane number and 1 corresponds to the lowest lane number.

‘shtime’-This refers to the shooting time. The author argues that longer shooting times are probably related to less automatic execution in a precision task, which might be linked to overthinking, speculating about possible outcomes and losing one’s focus. This potentially increases the probability of choking under pressure, i.e., missing the final shot.

The sign of the coefficients on the independent variables give the direction of the effect on the probability that the dependent variable is 1. For instance, a coefficient of -1 on ‘ability’ means that an increase in ability leads to a decrease in the probability of missing the fifth shot.

The results are being presented below (standard errors are in the parentheses below the coefficients). Consider column 4.

1. Calculate the t statistic for the coefficient on the variable ‘lane’.

2. Is there evidence to support the following hypothesis: Athletes who experience higher levels of pressure due their higher position in the ranking have a higher probability of experiencing deterioration in performance. Explain.

3. Is there evidence in support of the hypothesis that longer shooting times lead to an increase in the probability of missing the fifth shot? Explain

4. Does gender play a role in determining the probability of missed fifth shot?

5. Are these results evident of the phenomenon of ‘choking under pressure’?

In: Statistics and Probability

An economic agent has the following utility function over income. U(I) = √I/100. (square root of...

An economic agent has the following utility function over income.

U(I) = √I/100. (square root of I over 100)

Suppose the agent has $3600 in income. The agent faces the following choice. The agent can keep his current level of income or accept the following gamble. With some probability, P, the agent either wins $1300, or with some probability, 1-P, the agent loses $1100. Determine if the following statement is either True or False. For the agent to take the gamble, the probability of winning has to be greater than 11/24 because when the probability exceeds this value the expected value of the gamble is greater than 0.

In: Economics

A piston-cylinder device, whose piston is resting on a set of stops, initially contains 2 kg...

A piston-cylinder device, whose piston is resting on a set of stops, initially contains 2 kg of air at 300 kPa and 27ºC. The mass of the piston is such that a pressure of 600 kPa is required to move it upward. Heat is now transferred to the air until its volume doubles.

a) Determine the work done by the air and b) the total heat transferred to the air during this process. c) Also, sketch the process on a P-v diagram

In: Mechanical Engineering