<jupyter_start><jupyter_text>Before your start:- Read the README.md file- Comment as much as you can and use the resources (README.md file)- Happy learning!<jupyter_code># import numpy and pandas<jupyter_output><empty_output><jupyter_text>Challenge 1 - Exploring the DataIn this challenge, we will examine all salaries of employees of the City of Chicago. We will start by loading the dataset and examining its contents. Please, load the data using Ironhack's database (db: employees, table: employees_advanced).<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Examine the `salaries` dataset using the `head` function below.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>We see from looking at the `head` function that there is quite a bit of missing data. Let's examine how much missing data is in each column. Produce this output in the cell below<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Let's also look at the count of hourly vs. salaried employees. Write the code in the cell below<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>What this information indicates is that the table contains information about two types of employees - salaried and hourly. Some columns apply only to one type of employee while other columns only apply to another kind. This is why there are so many missing values. Therefore, we will not do anything to handle the missing values. There are different departments in the city. List all departments and the count of employees in each department.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Challenge 2 - Hypothesis TestsIn this section of the lab, we will test whether the hourly wage of all hourly workers is significantly different from $30/hr. Import the correct one sample test function from scipy and perform the hypothesis test for a 95% two sided confidence interval.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>We are also curious about salaries in the police force. The chief of police in Chicago claimed in a press briefing that salaries this year are higher than last year's mean of $86000/year a year for all salaried employees. Test this one sided hypothesis using a 95% confidence interval.Hint: A one tailed test has a p-value that is half of the two tailed p-value. If our hypothesis is greater than, then to reject, the test statistic must also be positive.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Using the `crosstab` function, find the department that has the most hourly workers.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>The workers from the department with the most hourly workers have complained that their hourly wage is less than $35/hour. Using a one sample t-test, test this one-sided hypothesis at the 95% confidence level.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Challenge 3: To practice - Constructing Confidence IntervalsWhile testing our hypothesis is a great way to gather empirical evidence for accepting or rejecting the hypothesis, another way to gather evidence is by creating a confidence interval. A confidence interval gives us information about the true mean of the population. So for a 95% confidence interval, we are 95% sure that the mean of the population is within the confidence interval. ).To read more about confidence intervals, click [here](https://en.wikipedia.org/wiki/Confidence_interval).In the cell below, we will construct a 95% confidence interval for the mean hourly wage of all hourly workers. The confidence interval is computed in SciPy using the `t.interval` function. You can read more about this function [here](https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.t.html).To compute the confidence interval of the hourly wage, use the 0.95 for the confidence level, number of rows - 1 for degrees of freedom, the mean of the sample for the location parameter and the standard error for the scale. The standard error can be computed using [this](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.sem.html) function in SciPy.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Now construct the 95% confidence interval for all salaried employeed in the police in the cell below.<jupyter_code># Your code here:<jupyter_output><empty_output><jupyter_text>Bonus Challenge - Hypothesis Tests of ProportionsAnother type of one sample test is a hypothesis test of proportions. In this test, we examine whether the proportion of a group in our sample is significantly different than a fraction. You can read more about one sample proportion tests [here](http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/SAS/SAS6-CategoricalData/SAS6-CategoricalData2.html).In the cell below, use the `proportions_ztest` function from `statsmodels` to perform a hypothesis test that will determine whether the number of hourly workers in the City of Chicago is significantly different from 25% at the 95% confidence level.<jupyter_code># Your code here:<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06118509940165991, 'fraction_numerical': 0.007913530206523836, 'mean_word_length': 5.669240669240669, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '451294', 'license': 'MIT', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1367, 'n_words': 664, 'path': 'module-2/Hypothesis-Testing/your-code/main.ipynb', 'repo_name': 'Skye-FY/daft-miami-0120-labs', 'size': '5181'}