I pasted the code from the URL (archive) into RStudio and ran the code. It creates three vectors that, without much analyzing, seem to be input vectors: x
, y
, y_ideal
:
x = seq(10,20,0.25)
y_ideal = x
N = length(x)
sd = 2
y = rnorm(N,y_ideal,sd) # rnorm(n,mean,sd)
Actually y_ideal
is just set to x
., so really you should only need x
and y
:
The function rnorm()
gives you a normal distribution with the variables:
I then made a data.frame
(aka "matrix") with the 3 vectors:
df <- data.frame(x,y,y_ideal)
a data frame can have an Excel-like view in RStudio:

and then exported it to a csv:
write.csv(df, 'deming.csv', row.names = FALSE)
which I'll put here for your convenience - and online
"x","y","y_ideal"
10,10.9277728455939,10
10.25,10.5933490961181,10.25
10.5,14.0852031368451,10.5
10.75,12.4232922691896,10.75
11,14.7683460256395,11
11.25,9.93532391180117,11.25
11.5,12.4777201750146,11.5
11.75,11.3343548513887,11.75
12,10.2801940515687,12
12.25,10.3694533979591,12.25
12.5,16.7670475398486,12.5
12.75,15.025087197753,12.75
13,15.747932175025,13
13.25,12.4146751515162,13.25
13.5,12.8150380193588,13.5
13.75,16.9127206628306,13.75
14,13.6818446843247,14
14.25,15.6428120655422,14.25
14.5,11.6094851517286,14.5
14.75,17.3868200845988,14.75
15,14.374938003457,15
15.25,16.5397831100747,15.25
15.5,16.5774828754729,15.5
15.75,16.0933165508874,15.75
16,14.0815845992991,16
16.25,16.1954498412194,16.25
16.5,20.62422023611,16.5
16.75,15.7032049193883,16.75
17,13.7508477699139,17
17.25,18.06073937896,17.25
17.5,19.8632816230287,17.5
17.75,18.1758896126998,17.75
18,18.1437515547828,18
18.25,18.5226369240186,18.25
18.5,15.8481144868907,18.5
18.75,20.3427101476114,18.75
19,21.6697499301055,19
19.25,21.7060773339034,19.25
19.5,20.6452923318518,19.5
19.75,17.1521716029471,19.75
20,17.6399835307955,20
The R script also generates this image:

and if you print dem.reg
> dem.reg@para
EST SE LCI UCI
Intercept 2.1266197 1.6300808 -1.1705300 5.423769
Slope 0.8943716 0.1066187 0.6787149 1.110028
Instructions for installing R and RStudio are here: https://rstudio.com/products/rstudio/download/#download
Here's what my screen looks like - you'll see RStudio has sort of a "Matlab" look and feel.
