R result1

png

School

Northeastern University *

*We aren’t endorsed by this school

Course

6010

Subject

Statistics

Date

Apr 3, 2024

Type

png

Pages

1

Uploaded by DukeOtterMaster1034

Report
55 #hypothesis testing for question2: 56 #Question:Is there a significant difference in the mean selling price between cars with high kilometers drive 57 58 # Define the threshold for kilometers driven 59 threshold <- 100000 60 61 # Create subsets for high and low kilometers driven 62 high_km_subset <- subset(cars_data, km_driven > threshold) 63 low_km_subset <- subset(cars_data, km_driven <= threshold) 64 65 # Calculate the mean selling price for both groups 66 mean_high_km <- meanChigh_km_subset$selling_price) 67 mean_low_km <- mean(low_km_subset$selling_price) 68 69 # Perform two-sample t-test 70 two_sample_t_test_result <- t.test(high_km_subset$selling_price, low_km_subset$selling_price) 71 72 # Print the mean selling price for both groups 73 print(paste("Mean Selling Price of High Kilometers Driven:", mean_high_km)) 74 print(paste("Mean Selling Price of Low Kilometers Driven:", mean_low_km)) 75 76 # Print the results of the two-sample t-test 77 print(two_sample_t_test_result) 78:1 (Top Level) < Console Terminal Background Jobs R R4.3.2 . ~/Desktop/NEU/Quarter 1/Session 2/ALY6010/Project/Final milestone 2/ > # Perform two-sample t-test > two_sample_t_test_result <- t.test(Chigh_km_subset$selling_price, low_km_subset$selling_price) > # Print the mean selling price for both groups > print(paste("Mean Selling Price of High Kilometers Driven:", mean_high_km)) [1] "Mean Selling Price of High Kilometers Driven: 439885.03652968" > print(paste("Mean Selling Price of Low Kilometers Driven:", mean_low_km)) [1] "Mean Selling Price of Low Kilometers Driven: 726476.27190385" > # Print the results of the two-sample t-test > print(two_sample_t_test_result) Welch Two Sample t-test data: high_km_subset$selling_price and low_km_subset$selling_price t = -19.689, df = 6274.6, p-value < 2.2e-16 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -315125.5 -258057.0 sample estimates: mean of x mean of y 439885.0 726476.3 R Sc
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help