作为此链接的非线性回归分析的输出图
https://stats.stackexchange.com/questions/209087/non-linear-regression-mixed-model
使用此数据集:
zz <-(" iso temp diam
Itiquira 22 5.0
Itiquira 22 4.7
Itiquira 22 5.4
Itiquira 25 5.8
Itiquira 25 5.4
Itiquira 25 5.0
Itiquira 28 4.9
Itiquira 28 5.2
Itiquira 28 5.2
Itiquira 31 4.2
Itiquira 31 4.0
Itiquira 31 4.1
Londrina 22 4.5
Londrina 22 5.0
Londrina 22 4.4
Londrina 25 5.0
Londrina 25 5.5
Londrina 25 5.3
Londrina 28 4.6
Londrina 28 4.3
Londrina 28 4.9
Londrina 31 4.4
Londrina 31 4.1
Londrina 31 4.4 …Run Code Online (Sandbox Code Playgroud) 如何在线性混合模型中为每个实验单元(图)提取系数(b0和b1)及其各自的标准误差,如下所示:
使用相同的数据集(df),对于拟合的模型(fitL1):我怎么能得到一个这样的数据框......
plot b0 b0_se b1 b1_se
1 2898.69 53.85 -7.5 4.3
... ... ... ... ...
Run Code Online (Sandbox Code Playgroud) 有人可以帮我解决这个错误吗?当我尝试.Rmd使用外部乳胶.bib文件编译西班牙语文档时,我遇到了下一个错误
---
title: "Untitled"
output:
pdf_document:
fig_caption: yes
bibliography: biblio.bib
lang: spanish
---
Run Code Online (Sandbox Code Playgroud)
并且错误消息是:
|.................................................................| 100%
label: unnamed-chunk-3 (with options)
List of 2
$ echo : logi FALSE
$ results: chr "asis"
/usr/bin/pandoc bib.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bib.pdf --filter /usr/bin/pandoc-citeproc --template /home/juanchi/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in' --bibliography biblio.bib
output file: bib.knit.md
pandoc-citeproc: could not find locale data for spanish
pandoc: Error running filter /usr/bin/pandoc-citeproc
Filter returned error status 1
Error: pandoc document …Run Code Online (Sandbox Code Playgroud) 有人可以帮我找出这个错误的解决方案吗?
install.packages(注明 "DevTools")
> * installing *source* package ‘RCurl’ ...
> ** package ‘RCurl’ successfully unpacked and MD5 sums checked checking for curl-config... no Cannot find curl-config ERROR: configuration
> failed for package ‘RCurl’
> * removing ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.0/RCurl’ Warning in install.packages : installation of package ‘RCurl’ had
> non-zero exit status ERROR: dependency ‘RCurl’ is not available for
> package ‘httr’
> * removing ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.0/httr’ Warning in install.packages : installation of package ‘httr’ had
> non-zero exit status ERROR: dependencies …Run Code Online (Sandbox Code Playgroud) 我想在RPubs中发布一个slidify演示文稿,但它需要PKI和rsconnect包.
尝试在R中安装PKI包时,我收到此错误消息
Installing package into ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
probando la URL 'http://cran.rstudio.com/src/contrib/PKI_0.1-1.tar.gz'
Content type 'application/x-gzip' length 20334 bytes (19 KB)
==================================================
downloaded 19 KB
* installing *source* package ‘PKI’ ...
** package ‘PKI’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c asn1.c -o asn1.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
In file included …Run Code Online (Sandbox Code Playgroud) 我\xc2\xb4m是一个使用flex-dashboards的新手...\n如何在两个不同的选项卡中分离输入信息和输出结果?这是一个简单的例子,我试图仅渲染第二个选项卡“输出”中的条形图
\n\n---\ntitle: "Dashboard"\noutput: \n flexdashboard::flex_dashboard:\nruntime: shiny\n---\n```{r global, include=FALSE}\n# load data in \'global\' chunk so it can be shared by all users of the dashboard\nlibrary(datasets)\ndata(WorldPhones)\n```\n\nInputs\n=======================================================================\n\n```{r, include=FALSE}\n# Shiny module definition (would typically be defined in a separate R script)\n\n# UI function\nworldPhonesUI <- function(id) {\n ns <- NS(id)\n fillCol(height = 600, flex = c(2, 1),\n inputPanel(\n selectInput(ns("region"), "Region1:", choices = colnames(WorldPhones))\n )\n )\n}\n\n# Server function\nworldPhones <- function(input, output, session) {\n output$phonePlot <- renderPlot({\n barplot(WorldPhones[,input$region]*1000, \n ylab = "Number of Telephones", xlab = …Run Code Online (Sandbox Code Playgroud) 我正在为网络元分析准备数据,而且我很难对列进行分类.
如果我有这个初始数据集:
Study Trt y sd n
1 1 -1.22 3.70 54
1 3 -1.53 4.28 95
2 1 -0.30 4.40 76
2 2 -2.60 4.30 71
2 4 -1.2 4.3 81
Run Code Online (Sandbox Code Playgroud)
我怎么能完成另一个呢?
Study Treatment1 y1 sd1 n1 Treatment2 y2 sd2 n2 Treatment3 y3 sd3 n3
1 1 1 -1.22 3.70 54 3 -1.53 4.28 95 NA NA NA NA
2 3 1 -0.30 4.40 76 2 -2.60 4.30 71 4 -1.2 4.3 81
Run Code Online (Sandbox Code Playgroud)
我真的陷入了这一步,我真的很感激一些帮助......
dat = structure(list(x = c(5L, 5L, 5L, 5L, 10L, 10L, 10L, 10L, 15L,
15L, 15L, 15L, 17L, 17L, 17L, 17L, 20L, 20L, 20L, 20L, 20L, 20L,
20L, 20L, 22L, 22L, 22L, 22L, 24L, 24L, 24L, 24L, 25L, 25L, 25L,
25L, 27L, 27L, 27L, 27L, 30L, 30L, 30L, 30L, 35L, 35L, 35L, 35L),
y = c(2.2, 2.2, 1.95, 1.9, 4.1, 3.95, 3.75, 3.4, 5.15, 4.6,
4.75, 5.15, 3.7, 4.1, 3.9, 3.5, 7, 6.7, 6.7, 6.95, 4.95, 6, 6.45,
6.4, 7, …Run Code Online (Sandbox Code Playgroud) 我需要创建一个具有三个段颜色的segplot:一个用于间隔低于1,一个用于间隔优于1,另一个用于包含1的间隔.
df <- read.table(header=T, text='
geno n rd lower upper
A7002 7 1.12 0.94 1.30
ANTA82RR 12 1.00 0.91 1.09
BR05-83097 5 0.84 0.41 1.27
BR05-86275 5 0.64 0.25 0.93
BRM04-1660 7 1.26 1.02 1.50
BRN03-1404 5 1.03 0.88 1.18
BRN05-0656 5 0.57 0.47 0.67
')
library(latticeExtra)
segplot(reorder(factor(geno), rd) ~ lower + upper,
data = df,
xlim=c(-1, 2.5),
draw.bands = FALSE, centers = rd,
panel = function (x,y,z,...){
panel.segplot(x,y,z,...)
panel.abline(v=1,lty=3)
}
)
Run Code Online (Sandbox Code Playgroud)
提前致谢.
我在安装任何软件包时遇到问题,也是从软件包存档.在这种情况下显示错误尝试安装ggplot2:
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so':
libicui18n.so.52: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2/ggplot2’
Warning in install.packages :
installation …Run Code Online (Sandbox Code Playgroud) 将此参数化用于增长曲线逻辑模型
我创建了一些点:K = 0.7; y0 = 0.01; r = 0.3
df = data.frame(x= seq(1, 50, by = 5))
df$y = 0.7/(1+((0.7-0.01)/0.01)*exp(-0.3*df$x))
Run Code Online (Sandbox Code Playgroud)
有人能告诉我如果用模型启动器创建数据我怎么能有一个拟合错误?
fo = df$y ~ K/(1+((K-y0)/y0)*exp(-r*df$x))
model<-nls(fo,
start = list(K=0.7, y0=0.01, r=0.3),
df,
nls.control(maxiter = 1000))
Error in nls(fo, start = list(K = 0.7, y0 = 0.01, r = 0.3), df, nls.control(maxiter = 1000)) :
number of iterations exceeded maximum of 1000
Run Code Online (Sandbox Code Playgroud) 使用此数据框:
table <- "
trt rep ss d1 d4 d5 d6 d7
1 1 1 0 0 0 0 0
1 1 2 0 0 0 0 0
1 1 3 0 0 1 2 2
1 2 1 0 0 1 3 6
1 2 2 0 1 1 2 4
1 2 3 0 0 0 1 1
1 3 1 0 0 0 0 0
1 3 2 0 0 0 0 0
1 3 3 0 …Run Code Online (Sandbox Code Playgroud) 功能绘图的简单示例:
p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x))
p + stat_function(fun = function(x) x^2 + 1*2)
Run Code Online (Sandbox Code Playgroud)
是否可以在ggplot中的绘图代码中添加参数列表?像这样的东西?
fun1 <- function(x) x^2 + a*b
p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x))
p + stat_function(fun = fun1, par=list(a=1, b=2)) + xlim(-5,5)
Run Code Online (Sandbox Code Playgroud) r ×12
ggplot2 ×2
nlme ×2
nls ×2
rstudio ×2
ubuntu ×2
coefficients ×1
convergence ×1
dashboard ×1
devtools ×1
dplyr ×1
knitr ×1
lattice ×1
list ×1
mixed-models ×1
pandoc ×1
pki ×1
r-markdown ×1
regression ×1
spread ×1