Question

Question 2 10 pts Take a look at the iris dataset that comes with R. The data can be loaded with the code: library(datasets) data(iris) A description of the dataset can be found by running ?iris What R code returns a vector of the means of the variables Sepal.Length, Sepal.Width, Petal.Length, and Petal.Width? apply(iris, 2, mean) applyliris, 1:4], 2, mean) apply(iris[, 1:4], 1, mean) rowMeans(iris[, 1:4])

0 0
Add a comment Improve this question Transcribed image text
Answer #1

R code that returns a vector of the variables 'Sepal.Length', 'Sepal.Width', 'Petal.Length', and 'Petal.Width' are : (b) apply(iris[, 1:4], 2, mean)

Add a comment
Know the answer?
Add Answer to:
Question 2 10 pts Take a look at the 'iris' dataset that comes with R. The...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • in R For the iris dataset, store the 50 sepal lengths for the 50 versicolor rises...

    in R For the iris dataset, store the 50 sepal lengths for the 50 versicolor rises in a vector x For the iris dataset, store the 50 sepal lengths for the 50 virginica irises in a vectory What are the means and the variances of x and y? The variances "seem" different. Perform Welch's t-test that is appropriate in such cases to check if the mean sepal lengths of Versicolor and Virginica irises are significantly different. What is the p-value...

  • [USING RSTUDIO] I am having trouble already in step 3 of number 1. Im not sure...

    [USING RSTUDIO] I am having trouble already in step 3 of number 1. Im not sure why what I typed isn't working. I appreciate anybody that can help me out. Thanks 1. Recall the `iris` data set from last week's exercise. The `iris` data set is already pre-loaded in R - look at the help file using `?iris` for more information on this data set.    i) Check the structure of the data using the function `str(iris)`.    ii) Find...

  • r code for, any dataset will y, x1 and x2 will be okay 3- Refer to...

    r code for, any dataset will y, x1 and x2 will be okay 3- Refer to Brand preference data and problem in Assignment 5 (30 pts) a) Transform the variables by means of the correlation transformation and fit the standardized regression model (10pts). b) Interpret the standardized regression coefficient (5pts). c) Transform the estimated standardized regression coefficients back to the ones for the fitted regression model in the original variables (5pts). d) Calculate R2X1, R2X2, R212, R2,1/2, R?y2|1 and R2....

  • Response All estions From Part 0 A. Researchers compared forest plots that had never been logged...

    Response All estions From Part 0 A. Researchers compared forest plots that had never been logged (Group 1) with simil ar plots nearby that had been logged 1 year earlier (Group 2) and 8 years earlier (Group 3). All plots were 0.1 hectare in area. Here are the counts of trees for plots in each group: 16 20 24 Group I 27 Group Group 3 18 4 22 15 18 19 22 12 1 14 19 Towhat extent has logging...

  • In R, Part 1. Learn to understand the significance level α in hypothesis testing. a) Generate a matrix “ss” with 1000 rows and 10 columns. The elements of “ss” are random samples from standard normal...

    In R, Part 1. Learn to understand the significance level α in hypothesis testing. a) Generate a matrix “ss” with 1000 rows and 10 columns. The elements of “ss” are random samples from standard normal distribution. b) Run the following lines: mytest <- function(x) { return(t.test(x,mu=0)$p.value) } mytest(rnorm(100)) Note that, when you input a vector in the function mytest, you will get the p-value for the one sample t-test H0 : µ = 0 vs Ha : µ =/= 0....

  • I only need the r code. the dataset we have is a .csv file. 3. (10...

    I only need the r code. the dataset we have is a .csv file. 3. (10 points) The data below are called ttable.csv on Bb. Read the data into R as a data frame "tmat" with names as shown. This data shows critical points for the Student t-distribution for degrees of freedom (by rows) 2, 3....10. Print the data frame to the screen as below. Then construct a graph as similar to the one shown below as you can Provide...

  • Your output should look as follows: DataSet = 10, 27, 32, 34, 35, 44, 48, 49...

    Your output should look as follows: DataSet = 10, 27, 32, 34, 35, 44, 48, 49 Descriptive Statistics: Minimum Maximum Range Size Sum Mean Median Standard Deviation Variance Mid Range = 10 = 49 = 39 = 8 = 279 = 34.875000 = 39.500000 = 12.788806 = 163.553571 = 29.5 Enter a integer value to be set in the DataSet: 50 Enter a valid index from the DataSet: 1 DataSet = 10, 32, 34, 35, 44, 48, 49, 50 Value...

  • 1. You have a dataset from a random sample of U.S. adults and are analyzing two...

    1. You have a dataset from a random sample of U.S. adults and are analyzing two variables measured as follows:Sex (0=male; 1=female) and Felony criminal record (0=no; 1=yes). Which statistic is most appropriate for describing the strength of the relationship between these two variables? Chi-square Phi-coefficient Goodman and Kruskal's gamma Yule's Q None of the above 2. A hypothesis test for the difference between two independent sample means assumes ____________. we have two samples that are independently selected we have...

  • Classification in Python: Classification In this assignment, you will practice using the kNN (k-Nearest Neighbors) algorithm...

    Classification in Python: Classification In this assignment, you will practice using the kNN (k-Nearest Neighbors) algorithm to solve a classification problem. The kNN is a simple and robust classifier, which is used in different applications. The goal is to train kNN algorithm to distinguish the species from one another. The dataset can be downloaded from UCI Machine Learning Repository: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/ (Links to an external site.)Links to an external site.. Download `iris.data` file from the Data Folder. The Data Set description...

  • Question 4) nhtemp is a built-in R dataset. The nhtemp data frame is a time series...

    Question 4) nhtemp is a built-in R dataset. The nhtemp data frame is a time series which gives the mean annual temperature in New Haven, Connecticut, from 1912 to 1970. Thus, there are 60 measurements. We are interested in some descriptive statistics related to nhtemp. We can access the data directly by using the assignment x <- nhtemp (In R use ?nhtemp for info on this dataset.) The values of nhtemp or x if defined as above are: [1] 49.9...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT