Homework1 1 PSYC274g – HW1 Provide your answers in a word document. When you are copying and pasting commands from R to word use Courier New Font. Submit it on BB using the link provided. 1. Your task...

1 answer below »
enter data into excel, then read it into R. Answer and make the commands in the, providing answers and pasting screenshot of histogram into answers


Homework1 1 PSYC274g – HW1 Provide your answers in a word document. When you are copying and pasting commands from R to word use Courier New Font. Submit it on BB using the link provided. 1. Your task for this question is to enter the data below into an excel file, save it as a .csv file, and answer the questions below based on this data set. These data show the score (out of 20) for 20 different students, some of whom are male and some female. Some of these participants were taught using positive reinforcement (being nice) and others who were taught using punishment (electric shock). Just to make it hard (because why not!), the data should NOT be entered in the same way that they are laid out below (Remember what information the columns and rows hold). a. Identify the variables (both independent and dependent) in this data set. b. Is the dependent variable a numerical or a categorical variable? c. Read your data from excel into R and answer the following questions using R: I. teaching_method <- read.csv()="" ii.="" use="" head()="" function="" to="" print="" the="" first="" 6="" rows="" of="" teaching_method.="" copy="" and="" paste="" those="" 6="" rows="" from="" r="" into="" your="" word="" document="" (use="" courier="" new.="" otherwise="" you="" will="" have="" alignment="" issues="" in="" word)="" iii.use="" tail()="" function="" to="" print="" the="" last="" 6="" rows="" of="" teaching-="" method.="" copy="" and="" paste="" those="" 6="" rows="" from="" r="" into="" your="" word="" document.="" iv.="" using="" subset()="" function,="" extract="" male="" students’="" scores="" who="" are="" taught="" using="" positive="" reinforcement="" male="" female="" electric="" shock="" being="" nice="" electric="" shock="" being="" nice="" 15="" 10="" 6="" 12="" 14="" 9="" 7="" 10="" 20="" 8="" 5="" 7="" 13="" 8="" 4="" 8="" 13="" 7="" 8="" 13="" 2="" psyc274g="" –="" hw1="" i.="" male_positive=""><- subset()="" v.="" find="" the="" mean="" and="" standard="" deviation="" of="" male_positive="" scores="" using="" the="" relevant="" functions:="" i.="" mean_male_positive=""><- ii.="" sd_male_positive=""><- 2.="" a="" data="" set="" named="" “housing.csv”="" is="" provided="" in="" hw="" folder="" on="" bb.="" you="" will="" use="" this="" data="" set="" to="" answer="" the="" rest="" of="" the="" questions.="" this="" data="" set="" has="" two="" columns;="" the="" first="" column,="" price,="" shows="" the="" price="" of="" the="" house,="" and="" the="" second="" column,="" age,="" shows="" how="" old="" the="" house="" is.="" a.="" read="" the="" data="" into="" r="" i.house=""><- read.csv() b. create a histogram of the variable price with bin size = 10 (you need to use breaks argument in the hist function. the exact number of bins r give you may not be 10). paste the histogram below with the command you used to create it. c. specify the shape of the data (symmetrical or right/left skewed) d. explain what the shape you specified in 2b. means. provide an explanation without using the concepts mean or median. e. based on the shape of the data, do you expect the mean or the median to be higher. explain why in one sentence. f. now you are going to group the houses based on their age. create a new column on your house data frame and name it category. use the table below to group the data, and add the category of each house under category variable. g. create bar graph of the category variable with axes and title provided. category range new x≤5 like new 6≤x≤9 old 10≤x≤19 very old x≥20 read.csv()="" b.="" create="" a="" histogram="" of="" the="" variable="" price="" with="" bin="" size="10" (you="" need="" to="" use="" breaks="" argument="" in="" the="" hist="" function.="" the="" exact="" number="" of="" bins="" r="" give="" you="" may="" not="" be="" 10).="" paste="" the="" histogram="" below="" with="" the="" command="" you="" used="" to="" create="" it.="" c.="" specify="" the="" shape="" of="" the="" data="" (symmetrical="" or="" right/left="" skewed)="" d.="" explain="" what="" the="" shape="" you="" specified="" in="" 2b.="" means.="" provide="" an="" explanation="" without="" using="" the="" concepts="" mean="" or="" median.="" e.="" based="" on="" the="" shape="" of="" the="" data,="" do="" you="" expect="" the="" mean="" or="" the="" median="" to="" be="" higher.="" explain="" why="" in="" one="" sentence.="" f.="" now="" you="" are="" going="" to="" group="" the="" houses="" based="" on="" their="" age.="" create="" a="" new="" column="" on="" your="" house="" data="" frame="" and="" name="" it="" category.="" use="" the="" table="" below="" to="" group="" the="" data,="" and="" add="" the="" category="" of="" each="" house="" under="" category="" variable.="" g.="" create="" bar="" graph="" of="" the="" category="" variable="" with="" axes="" and="" title="" provided.="" category="" range="" new="" x≤5="" like="" new="" 6≤x≤9="" old="" 10≤x≤19="" very="" old="">
Answered 1 days AfterFeb 18, 2021

Answer To: Homework1 1 PSYC274g – HW1 Provide your answers in a word document. When you are copying and pasting...

Suraj answered on Feb 20 2021
146 Votes
Assignment
Topic: R Programming
Submitted To:
Submitted By:
Consider the given table as follows:

a.
Here, from the above table. There are three variables. The variable gender is called the dependent variable and the two variables electric shock and being nice are independent variables. Because the values of both scores make effect on the gender variable. thus, the variable which is affected by other variables is called dependent variable and those which make effect to other are called independent variables.
b.
The dependent variable is gender. So, it can...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here