Reference no: EM133366705
Suppose you have 30 individuals who received a targeted ads and 20 individuals who received a public service announcement (PSA). There are three variables observed for each individual.
Age (an integer between 18 to 85);
Education level (categorical variable three categories: high school or below, bachelor's degree, graduate degree. Hint: you can consider using 1, 2, 3 to represent these three levels);
Seconds spent on watching the ads or PSA (an integer between 0 to 60 for targeted ads group, an integer between 3 to 34 for PSA group)
i) Write down the codes you would use to generate each of the variables. You can use Excel to test whether it works.
ii) Build an Excel table with five columns: first column is individual identification number subsequent from 1 to 50, name it "ID"; second column is whether the individual received targeted ads or PSA (it could be that the first 30 individuals received ads and the last 20 individuals received PSA), name it "Treatment"; the other three columns are the variables you just generated and name them "Age", "Education", and "Seconds" respectively). Save the Excel file and name it "adsdata". Take a screenshot of the table and paste below to show your work.