In: Math

# Problem 1. (a) The columns of response and factors can be defined in R as follows,...

Problem 1.

(a) The columns of response and factors can be defined in R as follows, use these codes to solve the problem.

y<-c(2, 3, 10, 12, 8, 4, 11, 8)##response : scores

a<-c("Heart","Heart", "Soul", "Soul","Heart","Heart", "Soul", "Soul")##factor A

b<-c("D", "D", "D", "D", "R", "R", "R", "R")##factor B (group variable)

(b) Find the overall mean, row means, column means, each cell mean for the table given in problem 1.

## Solutions

##### Expert Solution

R code:

y<-c(2, 3, 10, 12, 8, 4, 11, 8)##response : scores

a<-c("Heart","Heart", "Soul", "Soul","Heart","Heart", "Soul", "Soul")##factor A

b<-c("D", "D", "D", "D", "R", "R", "R", "R")##factor B (group variable)
M=data.frame(cbind(y,a,b))
#overall mean
G=mean(y)
# Row means
Row1=mean(y[1:4])
Row2=mean(y[5:8])
#column means
Column1=mean(c(y[1:2],y[5:6]))
Column2=mean(c(y[3:4],y[7:8]))
#Cell means
Cell_11=mean(y[1:2])
Cell_12=mean(y[3:4])
Cell_21=mean(y[5:6])
Cell_22=mean(y[7:8])
G
Row1
Row2
Column1
Column2
Cell_11
Cell_12
Cell_21
Cell_22

Output:

G
[1] 7.25
> Row1
[1] 6.75
> Row2
[1] 7.75
> Column1
[1] 4.25
> Column2
[1] 10.25
> Cell_11
[1] 2.5
> Cell_12
[1] 11
> Cell_21
[1] 6
> Cell_22
[1] 9.5

Overall mean=7.25
Mean of Row 1 (Level "D" of factor B)= 6.75
Mean of Row 2 (Level "R" of factor B)= 7.75
Mean of Column1 (Level "Heart" of factor A)= 4.25
Mean of Column2 (Level "Soul" of factor A)= 10.25
Mean of Cell (D, Heart)=2.5
Mean of Cell (D, Soul)=11
Mean of Cell (R, Heart)=6
Mean of Cell (R, Soul)= 9.5

## Related Solutions

##### Problem 1. Show that the cross product defined on R^3 by [x1 x2 x3] X [y1...
Problem 1. Show that the cross product defined on R^3 by [x1 x2 x3] X [y1 y2 y3] = [(x2y3 − x3y2), (x3y1 − x1y3), (x1y2 − x2y1)] makes R^3 into an algebra. We already know that R^3 forms a vector space, so all that needs to be shown is that the X operator is bilinear. Afterwards, show that the cross product is neither commutative nor associative. A counterexample suffices here. If you want, you can write a program that...
##### C++： A string construction problem defined as follows: - You are given as input a target...
C++： A string construction problem defined as follows: - You are given as input a target string - Starting with an empty string, you add characters to it, until your new string is same as the target. You have two options to add characters to a string: - You can append an arbitrary character to your new string, with cost x - You can clone any substring of your new string so far, and append it to the end of...
##### TYPED RESPONSE ONLY WITH AT LEAST 1 REFERENCE: List four factors that can shift the position...
TYPED RESPONSE ONLY WITH AT LEAST 1 REFERENCE: List four factors that can shift the position of an equilibrium. Only one of these factors can alter the value of the equilibrium constant. Which one is it?
##### Question 1 The adjusted trial balance columns of the worksheet for Martinez Company are as follows....
Question 1 The adjusted trial balance columns of the worksheet for Martinez Company are as follows. MARTINEZ COMPANY Worksheet (partial) For the Month Ended April 30, 2017 Adjusted Trial Balance Account Titles Dr. Cr. Cash 8,850 Accounts Receivable 7,769 Prepaid Rent 2,478 Equipment 23,235 Accumulated Depreciation—Equip. 5,386 Notes Payable 5,842 Accounts Payable 4,831 Share Capital—Ordinary 24,145 Retained Earnings 4,224 Dividends 3,287 Service Revenue 12,464 Salaries and Wages Expense 9,695 Rent Expense 842 Depreciation Expense 736 Interest Expense 22 Interest Payable...
##### 1. The completed financial statement columns of the worksheet for Blossom Company are shown as follows:...
1. The completed financial statement columns of the worksheet for Blossom Company are shown as follows: Blossom Company Worksheet For the Year Ended December 31, 2020 Income Statement Balance Sheet Account No. Account Titles Dr. Cr. Dr. Cr. 101 Cash 9,000 112 Accounts Receivable 10,600 130 Prepaid Insurance 2,800 157 Equipment 24,100 158 Accumulated Depreciation—Equip. 4,300 201 Accounts Payable 8,900 212 Salaries and Wages Payable 2,300 301 Owner’s Capital 20,000 306 Owner’s Drawings 10,300 400 Service Revenue 60,100 622 Maintenance...
##### Let A = R x R, and let a relation S be defined as: “(x​1,​ y​1)​...
Let A = R x R, and let a relation S be defined as: “(x​1,​ y​1)​ S (x​2,​ y​2)​ ⬄ points (x​1,​ y​1)​ and (x​2,​ y​2)​are 5 units apart.” Determine whether S is reflexive, symmetric, or transitive. If the answer is “yes,” give a justification (full proof is not needed); if the answer is “no” you ​must​ give a counterexample.
##### The subset-sum problem is defined as follows. Given a set of n positive integers, S =...
The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1, a2, a3, ..., an} and positive integer W, is there a subset of S whose elements sum to W? Design a dynamic program to solve the problem. (Hint: uses a 2-dimensional Boolean array X, with n rows and W+1 columns, i.e., X[i, j] = 1,1 <= i <= n, 0 <= j <= W, if and only if there is a subset of...
##### Define a sequence from R as follows. Fix r > 1. Let a1 = 1 and...
Define a sequence from R as follows. Fix r > 1. Let a1 = 1 and define recursively, an+1 = (1/r) (an + r + 1). Show, by induction, that (an) is increasing and bounded above by (r+1)/(r−1) . Does the sequence converge?
##### In R dataframes How to select :1/ a/--all columns for 6 cylinder cars with horsepower >=to...
In R dataframes How to select :1/ a/--all columns for 6 cylinder cars with horsepower >=to 100 b/-only columns mpg,cyl,disp and hp for cars with weight >=3000lbs
##### Using R and R Commander, perform a Chi-squared test of independence with marstatus in the Columns...
Using R and R Commander, perform a Chi-squared test of independence with marstatus in the Columns and gender in the Rows. Click on Statistics tab and select the first three options under Hypothesis Tests. Copy the output and paste it below this question. Is the Chi-squared test significant at the 5% alpha level? Are the results reliable? Please see data below. Can you explain? Frequency table:         marstatus gender   Divorced Married Single Female        2       6      9 Male          1       0      6...