User Tools

Site Tools


blog

Draw SEM path diagram using WebSEM

WebSEM provides a flexible way to draw path diagram. To use it, go to https://websem.psychstat.org.

If you are not ready to register yet, try out at https://websem.psychstat.org/apps/drawsem/ or https://websem.psychstat.org/apps/drawsem/pathdiag.php.

2013/02/23 14:59 · johnny · 0 Comments · 0 Linkbacks

Compile OpenBLAS for R on Windows

  1. Install MinGW using the installer: http://sourceforge.net/projects/mingw/files/latest/download?source=files Make sure install MSYS
  2. Install wget within MinGW: mingw-get install msys-wget
  3. Compile it using make
2013/02/05 16:09 · johnny · 0 Comments · 0 Linkbacks

LyX customized reference list

This can be used for APA style references in LyX of not want to use the bib file.

The following procedure can be used to create a list of references for your own style.

  1. Add a layout in Document – Settings – Local Layout with the following
        Style List
    Margin                Static
    LatexType             Item_Environment
    LatexName             reflist
    NextNoIndent          1
    LeftMargin            MMN
    LabelSep              xx
    ItemSep               0.2
    TopSep                0.7
    BottomSep             0.7
    ParSep                0.3
    Align                 Block
    AlignPossible         Block, Left
    LabelType             Itemize
    End
        
  2. In the Latex Preamble, add the following
    \newenvironment{reflist}{ 
    \begin{list}{}{\leftmargin=1em \itemindent=-1em}
    }{
    \end{list}
    }
2013/02/01 15:51 · johnny · 0 Comments · 0 Linkbacks

Install OpenBUGS 3.0.7 on Linux server

The following instructions were tested on Red Hat Enterprise Linux Server release 5.4 (Tikanga), Kernel version 2.6.18-164.11.1.el5. Could work for other linux releases.

Installation

The new version of OpenBUGS (v.3.0.7) can be run on Linux machine very easily. To install it on a linux machine, following these steps (adapted from openbugs.info)

  • Create a directory named OpenBUGS307 and create two sub-directories within it: bin and lib.
  • Download the shared library libOpenBUGS.so to the lib directory.
  • Download the bash shell script, OpenBUGS, to the bin directory.
  • Download the compiled C program, OpenBUGSCli to the bin directory.
  • Change the permission of OpenBUGS and OpenBUGSCli using
    chmod 755 OpenBUGS OpenBUGSCli

Use OpenBUGS

To use the interactive OpenBUGS, in the prompt, type the following and return (in the folder of bin)

./OpenBUGS

Below is an example to run OpenBUGS interactively using the Rats example:

$ ./OpenBUGS
OpenBUGS version 3.0.7 rev 397
type 'modelQuit()' to quit
OpenBUGS> modelCheck("model.txt")
model is syntactically correct
OpenBUGS> modelData("data.txt")
data loaded
OpenBUGS> modelCompile()
model compiled
OpenBUGS> modelInits("init.txt")
model is initialized
OpenBUGS> modelUpdate(1000)
1000 updates took 0 s
OpenBUGS> samplesSet("alpha0")
monitor set
OpenBUGS> samplesSet("beta.c")
monitor set
OpenBUGS> samplesSet("sigma")
monitor set
OpenBUGS> modelUpdate(10000)
10000 updates took 0 s
OpenBUGS> samplesStats("alpha0")
                         mean      sd        MC_error  val2.5pc  median    val97.5pc start     sample
 alpha0                  106.6     3.669     0.04221   99.41     106.6     113.6     1001      10000
OpenBUGS> samplesStats("*")
                         mean      sd        MC_error  val2.5pc  median    val97.5pc start     sample
 alpha0                  106.6     3.669     0.04221   99.41     106.6     113.6     1001      10000
 beta.c                  6.186     0.1091    0.001411  5.972     6.187     6.398     1001      10000
 sigma                   6.097     0.468     0.007489  5.263     6.07      7.106     1001      10000
OpenBUGS> samplesCoda('*', 'codafilename')
OpenBUGS> modelQuit()

To run OpenBUGS in batch format, one can save all the scripts in a file such as script.txt and then issue the command at the prompt

./OpenBUGS script.txt

Instructions for executing OpenBUGS can be obtained by typing

./OpenBUGS -h

Below is a list of related files used in the example

2010/03/17 22:05 · 1 Comment · 0 Linkbacks

Subfigures in LyX

This is an example form LyX website for using subfigures in LyX. I changed it a little to include multiple figures on multiple rows and columns.

The LyX file can be downloaded at example.lyx

The figure used can be downloaded at platypus.eps

The output looks like example.pdf

2010/02/02 17:56 · 0 Comments · 0 Linkbacks

<< Newer entries | Older entries >>


Note. Everything on this blog only reflects my personal view which may or may not be true and is not related to any organization or institute.

blog.txt · Last modified: 2024/09/17 13:50 by johnny