Displaying 1 result from an estimated 1 matches for "pkdat".
Did you mean:
pgdat
2009 May 06
1
Add trend line to XYPlot using a subset of the original data
...ines(x[pkyr],exp(x[pkyr]*(-my.lm$coef[2])+my.lm$coef[1]),col=3) #
this doesn't plot any line
And other variations on subsetting the data and calculating the slope.
If I create the same using the plot command, the slope of the trend based on
the subset of the data is correct.
pck<-!is.na(pkdat$X9444500)
plot(X9444500~WY,data=pkdat[pck,],xlim=c(1900,2020),ylab="TEST",
xlab="",ylim=c(100,100000),yaxp=c(100,100000,1),las=1,tck=.02,log="y",yaxs='i',xaxs='i',mgp=c(3,.5,0))
lines(pkdat$WY[pck],exp(predict.lm(lm(log(pkdat$X9444500[pck])~pkdat$WY[pck...