Linked Questions

0 votes
1 answer
391 views

I have two data frames which dimension are 24,523 × 3,468, and I want to get the scatter plot of them (data frame 1 in axis x and data frame 2 in axis 2)> then, I want to add a Loess line. I can ...
MK Huda's user avatar
  • 687
0 votes
0 answers
109 views

I understand geom_smooth() allows you to incorporate model (such as a linear regression) directly onto plot. But how do we go about doing this with more advanced models (kNN regression, elastic net, ...
DDD's user avatar
  • 41
0 votes
1 answer
79 views

all! New here. Much more comfortable with SQL but working on an R project. I created a point graph that didn't come out as expected. Here is the code that I entered And the result I guess I was ...
dat.a.tho's user avatar
339 votes
10 answers
525k views

I wonder how to add regression line equation and R^2 on the ggplot. My code is: library(ggplot2) df <- data.frame(x = c(1:100)) df$y <- 2 + 3 * df$x + rnorm(100, sd = 40) p <- ggplot(data = ...
MYaseen208's user avatar
  • 24.1k
25 votes
2 answers
12k views

On a thread on CrossValidated, I made the following comment: I suspect this is actually an R question about the difference between working with S3 classes (that are accessed via $) & S4 ...
gung - Reinstate Monica's user avatar
2 votes
1 answer
7k views

From the following question, we create some dummy data. Then it is converted into a format which ggplot2 can understand, and we generate a simple graph showing changes in var over time. test_data <...
user08041991's user avatar
2 votes
1 answer
4k views

My graph looks like this: As you can see there are 4 parameters (Treatment): NC, NF, TC, and TF. X axis shows the species number and Y shows the weight of crops. I want to draw a regression line of ...
Mr Good News's user avatar
1 vote
2 answers
3k views

I am trying to create linear correlation graph between to variables using ggplot2: dput(sum) structure(list(Date = structure(c(15218, 15248, 15279, 15309, 15340, 15371, 15400, 15431, 15461, 15492, ...
user1471980's user avatar
  • 10.7k
2 votes
1 answer
792 views

I'm trying to plot the lm line using this code df <- data.frame(c1=factor(c(1,1,1,1,2,2,2,2,3,3,3,3)),c2=c(65,42,56,75,43,43,21,23,12,12,21,11)) p <- ggplot(aes(x=c1,y=c2),data=df) p + ...
HappyPy's user avatar
  • 10.8k
0 votes
0 answers
719 views

Currently, I'm working building a regression model for the prediction of various financial variables. After data collection, I'm now looking into qqplots to determine differences in distributions of ...
Erwin R's user avatar
1 vote
1 answer
318 views

From a bootstrapping model I have 1000 sets of coefficients for this regression model: y = b0 + b1x + b2(x^2) What is the function call to plot a quadratic line if I already have the coefficients? I....
jbpib27's user avatar
  • 43
1 vote
1 answer
226 views

Notice that your graphic constructed from Problem 4 shows a quadratic or curved relationship between log_wages against exp. The next task is to plot three quadratic functions for each race level "...
Dario Gentiletti's user avatar
1 vote
1 answer
280 views

Assume I have data with a dependency y(t) and parameters p1, p2 and p3 which might influence the value y(t). I create 3 linear equations which depend on the following combinations of the parameters ...
Christoph's user avatar
  • 7,267
0 votes
0 answers
126 views

I have used ggplot to the below dataframe(cars dataset) for 2 categories. I need to have 2 regression equations for 2 categories. Below is the code I have executed to plot the graph cars$cat <- ...
Rfer R's user avatar
  • 69
0 votes
1 answer
61 views

Using instructions and data from this link: https://people.math.carleton.ca/~davecampbell/datasets/2020/07/24/trade-data-monthly-exports-of-grains-open-canada/ "First subset the data so that you ...
cchen's user avatar
  • 29