Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with R-studio, please add computation formula for me to better understand! how do you make three vectors (x, y and z) from randomly

need help with R-studio, please add computation formula for me to better understand!

  1. how do you make three vectors (x, y and z) from randomly generated numbers from a uniform distribution. (Hint - see "runif" in the cookbook.)
    1. Run correlations between x and y, x and z, and y and z
    2. how to make a data frame from the three vectors. how to get the output
    3. Find the means of the three columns of the data frame by using "apply" command
    4. Using the data frame you created, rerun the correlation between x and y. (Hint, you can select individual columns from a data frame. One way is to list the data frame and then select the specific column. For example, "df$x" refers to the x column in data frame "df". The "x" column from the data frame is specified by the dollar sign ($))
  2. Download and install two R packages - "ppcor" and "psych". (Hint - use "install.packages(" package name ") - keep the quotes - to download a package. Use library(package name) - no quotes - to make the R package available to your current R session.

a) how to make a vector of data. then I would need to use the function from the "psych" package called "describe" on the vector (hint - if the psych package installed correctly, the command describe (vector) should produce an output that includes 13 different descriptive statistics.

  1. how to run the partial correlation on your data frame using
    1. pcor
    2. partial.r

Note the partial correlations. Does the partial correlation change from the original correlation of X and Y? If so, how? What does this mean?

  1. How to make a scatter plot of x and y. The title of the plot should be "Correlation". Make sure thatthe X and Y axes are labelled ("x" and "y", or another title is fine).
    1. Add another set of data to the (same) plot of x and z using points and a different color for the points.
    2. Add another set of data to the (same) plot of y and z using points with a line connecting the points. (Also use a different color line and different symbol type (pch).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Classical Mechanics

Authors: R Douglas Gregory

1st Edition

0511159242, 9780511159244

More Books

Students also viewed these Mathematics questions

Question

Discuss the roles of metacognition in learning and remembering.

Answered: 1 week ago

Question

12.3 Explain employment termination of various occupational groups.

Answered: 1 week ago

Question

Define outplacement and severance pay.

Answered: 1 week ago

Question

What would you do?

Answered: 1 week ago