ゲームプランはここにあります。私は、このデータセット(構造オブジェクトになります)を以下のようにして、曲線回帰モデルを実行しようとしています。 次に、各点でスロープ(各xの1階微分値)を取得し、そのスロープ情報を持つデータテーブルを独自の列に保存します。カーブの予測モデルでスロープを取得するにはどうすればよいですか?テーブルとして保存してください。
INPUT.TXT:
yval xval
0.198 0.125
0.18 0.0625
0.126 0.03125
0.078 0.015625
0.066 0.007813
0.03 0.0039065
0.00 0.0
script.r:
dat <- read.table("input.txt", header=T, sep="\t")
library(drc)
library(ggplot2)
mm <- structure(list(x = dat$xval, y = dat$yval), .Names= c("x","y"), class = "data.frame")
model.drm <- drm (y ~ x, data = mm, fct = MM.2())
mml <- data.frame(x = seq(0, max(mm$x), length.out = 100)) #I actually don't know what length does, and am unsure about this line
mml$y <- predict(model.drm, newdata = mml)
ggplot(mm, aes(x = x, y = y)) +
theme_bw() +
xlab("x lab") +
ylab("y lab") +
ggtitle("dose response curve") +
geom_point(alpha = 0.5) +
geom_line(data = mml, aes(x = x, y = y), colour = "blue")
ggsave("mm.pdf", width = 6, height = 4)
#Need to pass in vector (list) of x, into the derivative of mml's function.
#Output will be a list of corresponding slope values for each of those x's.
#append said slope values to the data frame and save it.
dev.off()
概要: は、その後に斜面と同一のデータを保存し、各値に傾きを取る、回帰を実行し、データを取得別の列。出力は同じテーブルですが、新しい第3列:各x値に関連付けられた勾配です。
output.txtと::出力がどのように見える必要があります
yval xval slopes
0.198 0.125 slope1
0.18 0.0625 slope2
0.126 0.03125 slope3
0.078 0.01562 slope4
0.066 0.00781 slope5
0.03 0.00396 slope6
0.00 0.00 slope7
問題は、その情報「で取得」し、そしてどのようにそれを再保存する、私はいけない、物事を正しく行う方法を知っているだけか、です。イムは方程式にRがどのように計算をするかに慣れていない。私はsummary()から方程式の定数を得ることができますが、私はそれを処理する方法がありません。
私は適切な情報の組み合わせを見つけることができません(または、私が使用している検索用語だけです)。私は、これが間違った擬似コードのように見える場合はお詫び申し上げます。助けて?
Rバージョン3.2.4 Redhat Linuxでは4.1.2データがhttps://plot.ly/~gwaligroski/15/michaelis-menten-equation コードから借りhttps://rpubs.com/RomanL/6752から構成されている
これは良いスタートです。しかし、その時点での最初の派生物は何ですか?私は簡単に方程式にアクセスすることはできません、そして、私は最初にgeom_line曲線に基づいて最初の派生物になる方法について私は確信がありません。 geom_lineを支配する逆多項式の定数は、要約に埋め込まれています – Tom