2016-12-05 4 views
0

私はこのコードを持っていて、プロット内のすべてのグループに対して単一の回帰直線をプロットします。重ね合わされたxyplot(格子)内のすべての点の単一回帰

どうすればいいですか?

VOL<-xyplot(B$Inflow.Vol..During.Adv...m.3.~B$c..cm.|factor(dat$Group), 

scales=list(alternating=1, tck = c(1,0)), 

groups = B$Furrow, 

par.settings = list (superpose.line = list (lty = c(1, 2, 4) , lwd = lin2), superpose.symbol = list (pch = symbols)), 

auto.key = list (text = c("Furrow 1", "Furrow 3", "Furrow 5"),rows = 3, corner = c(0.95, 0.6), lines = FALSE , points = TRUE, title = ""), 

type = c("p","r"), cex = mycex2, grid=TRUE, xlab = "C", ylab = "Inflow Volume During Advance, m3") 

ありがとう:

(私は3つの畝のグループを持っている)これは私のコードです。

答えて

0

データを提供していません。データを提供する必要があります。

データセットirisを使用した例です。 panel関数内

xyplot(Sepal.Length~Petal.Length|cut(Sepal.Width,3),iris, groups=Species, panel=function(x,y,...){ l=lm(y~x) panel.xyplot(x,y,...) panel.abline(l) })

、データ及びフィットラインをプロットし、各パネルの回帰直線を算出します。

関連する問題