I have two data-frame with unequal number of rows. But i need to smooth the data in both the data frames and plot them together. I can smooth each dataframe with lowess/loess. However, when i try to plot the lines for both the data-frames together, i usually get error "unequal number of rows". I found a way around this by using spline
. I want to know if the following would be valid:
tmp1 <- spline( lowess( df1[,1], df[,2] ), n = 20 )
tmp2 <- spline( lowess( df2[,1], df2[,2] ), n = 20 )
plot( tmp1[,1], tmp1[,2], type="l" )
lines( tmp2[,1], tmp2[,2], col="red" )
I want to know whether it is "statistically" valid to plot spline of a lowess
object its its representation, because I want to limit number of data-points. This is specifically for case where the lowess
on to different series contain unequal number of points?