Question: ## PYTHON BASICS IN RSERVER -- please help with all, I will thumbs up response!! thank you 1. Compute the difference between 2022 and the
## PYTHON BASICS IN RSERVER -- please help with all, I will thumbs up response!! thank you
1. Compute the difference between 2022 and the year you started programming divide this by the difference between 2022 and the year you were born. Multiply this with 100 to get the percentage of your life you have been programming
2. Compute the mean of the square root of a vector of 100 random numbers. What happens?
3. Make a vector from 1 to 100. Make a for-loop which runs through the whole vector. Multiply the elements which are smaller than 11 or larger than 90 with 10 and the other elements with 0.1
4. Write a function for the previous ToDo, so that you can feed it any vector you like (as argument). You may use a for-loop in the function to do the computation with each element.
## Data Analysis
We will reproduce the exmaple given in the notes about [fitting a simple machine learnig model](https://pages.uwf.edu/acohen/TFDS/more-python-statmlviz.html#linear-models)). Exactly follow the example from the notes to do this part of the project using the data `chickwts` from `datasets` R package.
```{python} # Load the data import statsmodels.api as stat chickwts = stat.datasets.get_rdataset("chickwts", "datasets").data # load data "chickwts" from the R package 'datasets' ```
5. Plot histogram of the weights of chicks (see notes from [notes](https://pages.uwf.edu/acohen/TFDS/more-python-statmlviz.html#a-few-plots))
6. Split data to 25% training and 75% testing data sets (see notes from [notes](https://pages.uwf.edu/acohen/TFDS/more-python-statmlviz.html#linear-models))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
