Solved – Relationship between price and quantity in R

I tried to figure out how I can analyze this project. To find out how to analyze relationships between prices and quantities. I think with only two variables you can't build models.

For example, one pencil company sells
100 pencils for 10 dollars, 200 for $15, 300 for $30, 400 for $35, etc/

How can you analyse this relationship in R?

Assuming that the relationship is linear, you could do:

quantity <- c(100,200,300,400) price <- c(10,15,30,35) plot(quantity~price) fit <- lm(quantity~price) abline(fit) summary(fit) 

Similar Posts:

Rate this post

Leave a Comment