Editing
Software Plugins and Codes
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Running a model in R=== This is pretty much just following the example from the runjags documentation for autorun.jags . We determine the number of data points and stick our data in an R list format: n <- length(dataframe$cage) jagsdata <- list (age=dataframe$cage, y=dataframe$fnbmd10, n=n) We read in the model as a test string. This worked for me, but I suspect that there is an easier way. modelraw <- readBin("findcp.model", raw(), 9000) model <- rawToChar(modelraw) The last argument to readBin is the number of bytes to read. Just make sure that this is bigger than the file size and you will get the whole file. Now we run the model: results <- autorun.jags(model=model, monitor=c("b.cutoff", "b.slope", "b.intercept"), data=jagsdata) You can analyze the traceplots of the results to assess convergence: results$trace To get a summary of the monitored variables: results$summary This will look something like this: <source lang=text> Iterations = 1:21741 Thinning interval = 2 Number of chains = 2 Sample size per chain = 10871 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE b.cutoff 43.152034 5.9029519 4.003e-02 1.799e-01 b.slope -0.003935 0.0006817 4.624e-06 1.866e-05 b.intercept 0.832309 0.0102962 6.983e-05 2.305e-04 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% b.cutoff 31.641838 39.016150 42.733250 47.586850 53.975075 b.slope -0.005512 -0.004329 -0.003827 -0.003447 -0.002851 b.intercept 0.813198 0.825117 0.832013 0.839125 0.853183 </source>
Summary:
Please note that all contributions to bone.wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BoneWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Documents
Recent changes
Help
Tools
What links here
Related changes
Page information