Question: Upload your do file and log file to Canvas by 1 1 : 5 9 pm on January 3 0 th . 1 . load

Upload your do file and log file to Canvas by 11:59pm on January 30th.
1. load auto.dta, an example dataset installed with Stata
2. use a log file "PS1.log" to record all commands and related outputs
3. list variables that have the storage type of int
4. rename vairable "weight" to "lbs", rename variable "foreign" to "origin"
5. change the display format of "gear_ratio" such that only one decimal place is displayed
6. create a variable "brand" containing the brand name part of "make" (i.e., characters before the 1st space in "make")
7. assign value label to variable "rep78" in the following way:
label name: repair_status
item: 1<-> "Poor"
2<-> "Fair"
3<-> "Average"
4<-> "Good"
5<-> "Excellent"
8. add a new observation with the following values for four variables
make: "Toyota Rav4", mpg: 30, price: 9000, lbs: 3370, origin: 1
9. rearrange observations in alphabetical order based on the characters of "make"
10. relocate the variables "make" and "price" to the beginning of the dataset
11. shift the variable "lbs" after "mpg"
12. create a binary varaible "above10k" which takes a value of one if the car price is greater than 10,000
13. rearrange observations in descending order based on the value of "price"
14. create a variable "diff_price" containing the difference between the average price of foreign cars and the average price of domestic cars
15. display the number of observations with the value of "mpg" being greater than 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!