Using MATLAB to solve the following Problem3 Hospital Data M
Using MATLAB to solve the following
Problem-3: Hospital Data MATLAB has multiple built-in datasets that could be used for data processing and analysis One of those datasets is hospital mat\" which contains simulated hospital data. Run the following snippet code to load the data and get enveloping information about the fields in the data. load hospital summary (hospital) Your goals in this problem are to write MATLAB codes to 1. Obtain the number of male patients and the number of female patients in the dataset. Compare your results to the ones obtained when you run summary (hospital) 2. Obtain the number of smokers and non-smokers in the dataset. Again compare your results to the ones obtained when you run summary (hospital) 3. average the average age of the female patients and the Compute age of the male patients. 4. Compute the average weight of the female patients and the average weight of the male patients. 5. Compute the average weight for the female patients that are smoker and have an age below 45 6. Compute for each patient the mean of the number of trials and add the results to the table with a column header of Mean Trials. For the patients that have missing number of trials replace the NaN values with 0 7. A blood pressure less than 120/80 mmHg is normal A blood pressure of 140/90 mmHg or more is too high. People with levels in between 120/80 and 140/90 have a condition called prehypertension, which means they are at high risk for high blood pressure. Given this information how many patients in the provided data have a normal blood pressure, a too high blood pressure, or have the pre hypertension condition? 8. Compute the average blood pressure for the smoker and non smoker patients Which group is the healthiest? Justify your answer.
Solution
1 To find number of males and females:
1.The groupname is hospital and we find the number of by their sex.
countMale = hospital(hospital.Sex==\'Male\',:);
countfeMale = hospital(hospital.Sex==\'FeMale\',:);
