Problem 3)

Lilly collects data on a sample of 40 high school students to evaluate whether the proportion of female high school students who take advanced math courses in high school varies depending upon whether they have been raised primarily by their father or by both their mother and their father. Two variables are found below in the data file: math (0 = no advanced math and 1 = some advanced math) and Parent (1= primarily father and 2 = father and mother).

Parent Math
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
1.0 0.0
2.0 0.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 1.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0
2.0 0.0

a) Conduct a crosstabs analysis to examine the proportion of female high school students who take advanced math courses is different for different levels of the parent variable.
b) What percent female students took advanced math class
c) What percent of female students did not take advanced math class when females were raised by just their father?
d) What are the Chi-square results? What are the expected and the observed results that were found? Are they results of the Chi-Square significant? What do the results mean?

We do not do your homework for you. Although it might take more effort to do the work on your own, you will profit more from your effort. We will be happy to evaluate your work though.

However, I will give you some help.

X^2 = ∑ (O-E)^2/E, where O = observed frequency and E = expected frequency.

∑ = sum of all the cells.

E = (column total * row total)/grand total

df = n - 1, where n = number of cells

Look up value in X^2 table in the back of your textbook.

a) To conduct a crosstabs analysis, you will need a software or program that allows you to perform statistical analysis. One commonly used statistical software is R, which has the "table" function for crosstabs analysis.

Assuming you have the data in a data frame called "data", you can use the following R code to perform the crosstabs analysis:

```R
# Load the required library
library(gmodels)

# Create a crosstabs table
crosstab <- CrossTable(data$Parent, data$Math, prop.chisq = FALSE)

# Print the crosstabs table
crosstab
```

The output will show you the crosstabs table, which displays the frequencies and percentages of advanced math courses taken by different levels of the parent variable.

b) To calculate the percentage of female students who took advanced math class, you need to determine the proportion of students with a math value of 1 (indicating advanced math) and divide it by the total number of female students.

From the crosstabs table obtained in part a, you can find the number of female students (parent = 2) who took advanced math (math = 1). Let's assume this count is denoted by "female_adv_math_count".

Then, calculate the percentage using the formula:

```R
percent_female_adv_math <- (female_adv_math_count / sum(data$Parent == 2)) * 100

percent_female_adv_math
```

The output will show you the percentage of female students who took advanced math class.

c) To calculate the percentage of female students who did not take advanced math class when raised by just their father (parent = 1), you need to determine the proportion of students with a math value of 0 (indicating no advanced math) and divide it by the total number of female students raised by just their father.

From the crosstabs table obtained in part a, you can find the number of female students (parent = 1) who did not take advanced math (math = 0). Let's assume this count is denoted by "female_no_adv_math_count".

Then, calculate the percentage using the formula:

```R
percent_female_no_adv_math <- (female_no_adv_math_count / sum(data$Parent == 1)) * 100

percent_female_no_adv_math
```

The output will show you the percentage of female students who did not take advanced math class when raised by just their father.

d) To obtain the Chi-square results, you can use the crosstabs table from part a and apply the Chi-square test of independence. The Chi-square test measures whether there is a significant association between the two categorical variables (Parent and Math).

Assuming you have the crosstabs table stored in the variable "crosstab", you can use the following R code to perform the Chi-square test:

```R
# Perform the Chi-square test
chi_squared <- chisq.test(crosstab$table)

# Print the Chi-square results
chi_squared
```

The output will show you the Chi-square statistic, degrees of freedom, p-value, and other relevant information.

To interpret the results, you can compare the calculated p-value with a chosen significance level (e.g., 0.05). If the p-value is less than the significance level, you can reject the null hypothesis and conclude that there is a significant association between the Parent and Math variables. Otherwise, if the p-value is greater than the significance level, you fail to reject the null hypothesis and conclude that there is insufficient evidence to suggest a significant association.

Additionally, the crosstabs table obtained in part a can provide the observed and expected frequencies. The observed frequencies represent the actual counts in the data, while the expected frequencies are the counts that would be expected under the assumption of independence between the variables. The Chi-square test compares the observed and expected frequencies to evaluate the association between the variables.