Skip to content

Archive for

lavaan package for Structural Equation Model in R


lavaan is a package for running a “Structural Equation Models” or SEM in R. The script of lavaan is similar to Mplus, which is very comprehensive and compact. The lavaan package is developed by Yves Rosseel.

The following is my lavaan script I used in my presentation at R useR! 2011.

##-------------------------------------------------##
##    Measuring Transaction Cost in Supply Chains  ##
##               Pairach Piboonrungroj             ##
##         R useR conference August 2011           ##
##-------------------------------------------------##
# 1. Load data
hoteldata <- read.csv("https://www.dropbox.com/s/fzh040xkhofozjy/cleandata.csv")
# 2. Install Package
install.packages("lavaan")
# 3. Load Package
library(lavaan)
#5. Structural Model
TC.Model <- '
# latent variable definitions
cost =~ TC1 + TC2 + TC3 +TC6 + TC7   +TC11  + TC13
asset =~ AS1 + AS2
uncertainty  =~ UN1 + UN2
# regression
cost ~ uncertainty + asset
# resident (co)variance
TC1 ~~ TC3
TC6 ~~ TC13
TC11 ~~ TC13
TC13 ~~ AS1
'
fitTC <- sem(TC.Model, data = hoteldata)
summary(fitTC, standardized = TRUE, fit.measures=TRUE)
# Coefficients
# coef(fitTC)
#More indices
# Fit indices e.g. CFI
fit.indices <- inspect(fitTC, what = "fit")
fit.indices["cfi"]
# Calling Modification Indices
# inspect(fitTC, what = "mi")

See more details about the model and the comparison with other R packages and software

Tourism Associations and Agencies in Thailand – รายชื่อสมาคมและหน่วยงานด้านการท่องเที่ยวในประเทศไทย


หน่วยงานภาครัฐ

  1. กรมการท่องเที่ยว (Department of Tourism)
  2. กระทรวงการท่องเที่ยว และ กีฬา (Ministry of Tourism and Sports)
  3. การท่องเที่ยวแห่งประเทศไทย (Tourism Authority of Thailand)

ระดับประเทศ

  1. สภาอตสาหกรรมท่องเที่ยวแห่งประเทศไทย (Thailand Tourism Council)
  2. สมาคมโรงแรมไทย (Thai Hotel Association)
  3. สมาคมสปาไทย (Thai Spa Association)

ระดับภาค

  1. สมาคมโรงแรมภาคอีสาน

ระดับจังหวัด

  1. เชียงใหม่
    สมาคมธุรกิจท่องเที่ยวจังหวัดเชียงใหม่ (Chiang Mai Tourism Business Association)
    สมาคมมัคคุเทศน์ เชียงใหม่ (Chiang Mai Guide Association) 
  2. สมาคมธุรกิจท่องเที่ยวจังหวัดภูเก็ต (Phuket Tourist Association)
  3. สมาคมธุรกิจการท่องเที่ยว จังหวัดพิษณุโลก
  4. สมาคมท่องเที่ยวเกาะสมุย (Tourism Association of Koh Samui)
  5. สมาคมการท่องเที่ยวและโรงแรมจังหวัดตรัง (Trang Tourism and Hotel Association)
  6. ศูนย์ข้อมูลการท่องเที่ยวจังหวัดนครศรีธรรมราช
  7. สมาคมสมาพันธ์ธุรกิจการท่องเที่ยว จังหวัดสงขลา (Tourists Business Federation of Songkhla)

Tsunami Watch Update – April 2012 – สรุป รายงานข่าว การเตือนภัยสึนามิ จากแผ่นดินไหว ปี พ.ศ. 2555


Picture: BBC

ล่าสุด

‎19.30 น.

ศูนย์เตือนภัยพิบัติฯ แจ้งภัยสึนามิครั้งนี้ไม่มีผลกระทบรุนแรงแล้ว

คนกระบี่+ภูเก็ตทยอยลงจากที่สูงแล้ว

เครดิต ThaiPBS อ้างจาก Facebook น้ำขึ้น ให้รีบบอก

รายงานจากสำนักข่าวทั่วโลก

  1. BBC อังกฤษ
    รายงานข่าวและภาพเหตุการณ์
  2. Al Jazeera กาตาร์
    มีการสัมภาษณ์ผู้เชียวชาญ เกี่ยวกับผลกระทบซึ่งไม่น่ารุนแรงเท่าปี 2005  เนื่องจากเป็นการเคลื่อนตัวของเปลือกโลกที่ต่างกัน
  3. ABC ออสเตรเลีย
    รายงานสถานการณ์นาทีต่อนาที (Live Blog)
  4. Reuter สหรัฐอเมริกา
    รายงานข่าวด่วน
  5. CNN สหรัฐอเมริกา
    รายงานข่าวการเตือนภัยจากนานาชาติ
ความคืบหน้าการเตือนภัย
  • ศูนย์เตือนภัยสึนามิเปซิฟิก (Pacific Tsunami Warning Center) ได้ยกเลิกการเฝ้าระวังสึนามิจากการเกิดแผ่นดินไหวหลักทั้งสองครั้งรวมถึง after shock

ที่มา: TSUNAMI BULLETIN NUMBER 006 PACIFIC TSUNAMI WARNING CENTER/NOAA/NWS ISSUED AT 1236Z 11 APR 2012

  • “ศูนย์เตือนภัยสึนามิเปซิฟิก  (Pacific Tsunami Warning Center) ปรับพื้นที่เฝ้าระวัง “ตัดประเทศไทยออก” เหลือ อินโดฯ อินเดีย ศรีลังกา และ มัลดีฟ” อ้างอิงจากผู้สื้อข่าวภาคสนามของ ABC  Zoe Daniel ‏ @seacorro

“Pacific Tsunami Warning Centre has reduced watch areas to:Indonesia,India,Sri Lanka,Maldives.”

  • สนามบินภูเก็ตบินจนถึง 8 โมงเช้า 12 สิงหา
  • “@nnanews: มีรายงานแผ่นดินไหวอีกครั้ง เมื่อเวลา 17.21 วันนี้ ขนาด 5.2 ริกเตอร์ขอบคุณ ข่าว/ภาพ : FM 100.5 News Network http://t.co/IRZSaG16”
  • วันที่ 11 เมษายน 2555 เวลา 15.38 น.แผ่นดินไหวในทะเล8.9R.บริเวณตอนเหนือของเกาะสุมาตรา ความลึก 10กม. จึงขอแจ้งเตือนภัยเพื่ออพยพไปที่ปลอดภัยโดยเร็วและติดตามข้อมูลเพิ่มเติม(ศูนย์ เตือนภัยพิบัติแห่งชาติ พุธ, 11 เมษายน 2012)

PhD Tips: Publishing a Journal Article in Social Science


Here are the Tips I have learnt from the doctoral training on “Publishing a journal article in social science” by Dr.Sara Delamont at Cardiff University, UK. (10 April 2012)

Type of publication

  1. Kickstarts with Book Review. Then you will learn about the publishing process. Get in touch with the book review editor of the journal you are interested to publish a research article in the future.
  2. Research note is another good way to get start. It is relative short. There is usually less review time and difficulty.
  3. Book chapter is another alternative. It is better to publish in a peer-reviewed book.
  4. Academic peer-review journal is the top quality type of academic publication. One of the main reason is they are peer-reviewed.

How to select the journals 

  1. Journals that fit with your subject
  2. Journals you read
  3. Consider audience of the journals. Who read it?
  4. Call for papers if it fits your paper. But it could be more competitive than normal submission.
  5. Rejection Rate. Some journals publish the rate. If not, you may ask the editors.
  6. STATUS including Impact Factor (refer to how much papers in that journal have been cited in other journals), Editors, Editorial board.

Check list

  1. Format of the journal
  2. In the right Length
  3. Since one of the reviewers often from the editorial board. You should have read their papers before unless it may be not the right journal for you.

Posible verdict

  1. Accept without correction – Unlikely happen
  2. Accept with minor revision – Very good possible outcome
  3. Revise and resubmit – Look at the feedback and Consider if you can do the required revisions.
  4. Wrong journal – Consider other journal and your decision!
  5. Reject – Revise the paper according to the feedback you receive. Improve the paper and resubmit to the same journal or other journals

How to deal with the feedback and revisions

  1. Be realistic.
  2. Reply that the feedbacks are useful (even though they are not)
  3. Reply what you will revise in the manuscript and how long it would take aproximately (be realistic!)
  4. Compile the feedbacks fro different reviewers. Make a table consisting of issues in the feedback and reviewers.
  5. Revise the issues that are mentioned by all reviewers.
  6. For the issues that are not mentioned by all reviewers, if you d not want to review, give the courtesy and explain why you have not done so.
  7. After finishing the revision, write a systematic report to the editor what the reviewers said and what you have done with the page of the correction. The report may be in a table format.

How to licence your thesis using Creative Commons


One of the main objectives of PhD thesis (dissertation) is to advance the subject by making a contribution. Traditionally theses have been licensed under the copyright where all rights are reserved. And I also did put “All rights reserved” on the cover page of my thesis when I first drafted it. But just today when I realised that I should replace it by a “Creative Commons” one which could enhance the contributions and the impacts of my thesis.

Therefore I adopted the CC BY-NC-ND licence.  Then others are free to copy, distribute and transmit the work with some conditions.

To do so, I inserted the artwork of the By-NC-ND licence and put the sentence ” This thesis is licensed under a Creative Commons Attribution-Non Commercial-No Derivs 3.0 Unported License.” with the link to Creative Commons site that explain the licence.

1. Choose a licence you will use for your thesis here

2. Download the button of the licence you here and save the image in the LaTeX script folder of your thesis. I named my image as cc-by-nc-nd.png

3. Put the following LaTeX code on the title page of your thesis

line 06: Place your licence file name. Mine is “cc-by-nc-nd.png”.
line 10: Place the URL link to your licence and its description.

LaTeX code:

%Insert Creative Commons Artwork
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\begin{center}
\leavevmode
%Insert image file name below "cc-by-nc-nd.png"
\includegraphics[width=1in]{cc-by-nc-nd.png}
\end{center}
\label{fig:cc}
%insert a link to the licence and its description below
\scriptsize{This thesis is licensed under a \href{http://creativecommons.org/licenses/by-nc-nd/3.0/}{Creative Commons Attribution-Non Commercial-No Derivs 3.0 Unported License.}}

4. Finally you will get the following on the title page of your thesis.

Back to LaTeX tips