- Survival Analysis with Stata - Stephen P. Jenkins
- What is the relationship between baseline hazard and baseline hazard contribution?
- Cox's Proportional Hazards Model and Cox Regression - Princeton University
- How to get the hazard and survival functions for a specific time point?
- Introduction to Duration Models - Matt Golder
Disclaimer: This blog site is intended solely for sharing of information. Comments are warmly welcome, but I make no warranties regarding the quality, content, completeness, suitability, adequacy, sequence, or accuracy of the information.
Tuesday, November 27, 2012
Survival analysis using Stata
Survival analysis using Stata
Monday, November 19, 2012
Stata Programming
Stata programming
- Stata Blog: Programming an estimation command in Stata: A map to posted entries
- Manage the ado programs
- Stata Syntax-highlighting for Notepad++ or download from the Notepad++ website
- Syntax Highlight Packages (Dynamic documents in Stata: MarkDoc, Ketchup, and Weaver): Synlight, Weaver, MarkDoc
- Determine build-in command or ado-file: which command
- Check codes: viewsource command or type "directory\xxx.ado"
- list of the packages: ado dir
- Install: ssc install package
- check update: adooupdate
- update: adoupdate, update
- uninstall: ado uninstall package|[#]
- re-run profile.do: do profile.do
- How to edit an ado file, '- ADOEDIT -': module to edit ado file in Stata's do-file editor
- Programming Stata of Stata Tutorial - Princeton University.
- The University of Wisconsin provides nice websites for Stata for Researchers and Programming in Stata. The new Stata Programming Essentials is better for new programmers and the new Stata Programming Tools is better for more advanced persons.
- Macro: global and local macros: macro dir/macro drop
- Example Macro with `' and/or "":
- for both local and global macro, braces { and } can be used to form nested constructions.
- global pth "c:\abc\"
- di "${pth}def\" // ==> c:\abc\def\
- local x 2+2
- di "x" // ==> x
- di `x' // ==> 2+2 ==> 4
- di "`x'" // ==> 2+2
- local x=2+2 // ==> local x 4
- di `x' // ==> 4
- di "`x'" // ==> 4
- di "`=2+2'" // ==> 4
- di "`2+2'" // ==> N/A
- local x 2
- di "`=`x'-2'" // ==> 0
- local pth "c:\project"
- di "`pth'\data\" //==> "c:\project\data\"
- global pt "c:\project"
- di "$pt\data\" //==> "c:\project\data\"
- di "${pt}data\" //==> "c:\projectdata\"
- local a 2+3
- local b 7
- display `a'+`b' //==> 10
- display "`a'+`b'" //==> 2+3+7
- display "`a'"+"`b'" //==> 2+3+"7" invalid name
- display "`a'""+""`b'" //==> 2+3+7
- regress mpg weight
- local rsqf e(r2)
- local rsqv = e(r2)
- di "R-squared_1f=`rsqf'" //==> R-squared_1f=e(r2)
- di "R-squared_1v=`rsqv'" //==> R-squared_1v=.6515312529087511
- di "R-squared_2f=" `rsqf' //==> R-squared_2f=.65153125
- di "R-squared_2v=" `rsqv' //==> R-squared_2v=.65153125
- di "R-squared_3f=" "``rsqf''" //==> R-squared_3f=.6515312529087511
- di "R-squared_3v=" "``rsqv''" //==> N/A
- Stata Blog: Programming an estimation command in Stata
- Example 1: Storing and extracting the result of an extended macro function
- local count : word count a b c
- display "count contains `count'" ==> count contains 3
- Example 2: Using gettoken to store first token only
- local mylist y x1 x2
- display "mylist contains `mylist'" ==> mylist contains y x1 x2
- gettoken first : mylist
- display "first contains `first'" ==> first contains y
- Example 3: Using gettoken to store first and remaining tokens
- gettoken first left: mylist
- display "first contains `first'" ==> first contains y
- display "left contains `left'" ==> left contains x1 x2
- Example 4: Local macro update
- local p = 1
- local p = `p' + 3
- display "p is now `p'" ==> p is now 4
- Example 5: Local macro update
- local p = 1
- local ++p
- display "p is now `p'" ==> p is now 2
Friday, November 16, 2012
The rule of thumb: AIC preference/signficance levels
The rule of thumb: AIC and BIC preference/signficance levels
The Akaike information criterion (AIC) is a measure of the relative goodness of fit of a statistical model, which was developed by Hirotsugu Akaike in 1974. It was not much appreciated until 21 century. Now it’s one of the most used fit statistic output for statistical modeling. The preferred model is the one with the minimum AIC value; however, there are no statistic test for model choice based on this criterion. I found a table in Joseph M Hilbe’s book (Negative Binomial Regression, 2nd Ed, 2011) which may help us to choose a better model. Below is a table I modified based on his confusing table:
AIC = -2(log-likelihood) + 2(number of predictors including the intercept)
========================================
AIC of (Model A – Model B) , if AIC(A) > AIC(B)
----------------------------------------------------------------
< 2.5 No difference in models
2.5 – 5.9 Prefer B if sample size n > 256
6.0 – 9.9 Prefer B if sample size n > 64
≥ 10.0 Prefer B
========================================
Another criterion measure is Bayesian information criterion (BIC). Raftery AE (1995) gave the scale for relative preference of two models (I modified the table in Hilbe's book):
BIC = -2(log-likelihood) + (number of predictors including the intercept)*(ln(sample size))
========================================
BIC of (Model A – Model B) , if BIC(A) > BIC(B)
----------------------------------------------------------------
< 2.0 Weak
2.0 – 5.9 Positive and prefer B
6.0 – 9.9 Strong and prefer B
≥ 10.0 Very strong and prefer B
========================================
Sunday, November 11, 2012
Gardening and Cooking
Gardening
- How to build a raised vegetable garden. - This Old House
- How to Garden tips or Gardening Help - BackyardGardener.com
- Pest Control: spray Bifen Bifenthrin (Wiki), which is one major chemial of Ortho Home Defense Max (how to use it), using Gilmour 362 Professional No Pre-Mix Sprayer (Youtube, set 2 for ants control).
- Today's Homeowner with Danny Lipford
- YouTube. Pavestone Paver Installation
- Allrecipes.com - recipes, menus, meal ideas, food, and cooking tips. It has a Chinese version website called 十全菜谱.
- MyRecipes.com Find the Best Recipes, Dinner Ideas, and Menus
- Food Network - Easy Recipes, Healthy Eating Ideas and Chef Recipe Videos
- Rasa Malaysia - Recipes site for home cooks who love Chinese recipes, Japanese, Thai, Malaysian & Asian recipes. Easy recipes with tips and gorgeous food photography.
- Epicurious
- 心食谱 - 菜谱大全
- 美食杰 - 做你最喜爱的美食,食谱,菜谱网
- 美食天下 - 中国最具人气美食网
- 菜谱网
- 豆果网 - 中文美食菜谱分享网站
- 品味舌尖上的中国:《舌尖上的中国》播出后迅速风靡网络,才下舌尖,又上心头的不仅仅是美味更有温情,现在就跟着百度经验一起走进美食背后,揭秘那缱绻在味蕾之间的东方况味,亲手打造一场饕餮盛宴,让您品尽南北美食,体会百味人生!
- Wheat Gluten (Seitan)
- How To Make Seitan (Wheat Gluten) from Flour - Eating Rules.
- Homemade Gluten - Youtube
- Seitan - The Vegetarian Wheat Meat - Vegetarian Resource Group
- 自制面筋 - 心食谱
- Tofu
- Coagulant: Nigari coagulant (Magnesium Chloride 氯化镁 for 卤水豆腐) or glucono-delta-lactone (葡萄糖内脂 for 内酯豆腐). As alternatives: 3 cups of dry soy beans and 2 TBSP of Epsom Salt, or you may use 75ml of lemon juice.
- 终于吃上自己做的豆腐了——如何做卤水豆腐
- How to Make Tofu - YouTube
- How to Make Tofu—no fancy equipment required - La Fuji Mama
- How to Make Tofu at Home - Soy Milk Makers
- How to Make Fresh Silken Tofu from Soy Milk
- How to Make Your Tofu And Eat It, Too - NPR KitchenWindow
- Yelp.com is a great website to find great local restaurants.
- Kiku Japanese Steak & Sushi House, Atlanta, Georgia (Lenox location)
- Ana White - Woodworker & DIYer
- Wood Worker's Workshop: Free Woodworking Plans
- Family Handyman
- This Old House
- ToolGuyd – The Latest Tool Reviews, New Tool Previews, Best Tool Picks & Deals Blog
- YouTube: Replace your iPhone 5 battery in 2 Minutes
- How to DIY a passport photo
- How to turn off/on the ANC (active noise cancellation) system of 2013 Honda Pilot
- How to make your own Rivnut tool and install the Pilot running board by yourself:
- How to Install and Set a 3TB Hard Drive for Desktop PC (YouTube)
- How to recover a lost partition of a hard drive
- How to fix "The File Or Directory Is Corrupted Or Unreadable" and Hard Drive Wont Open (YouTube)
- Northview High School 2017 Robotics Banquet
Thursday, November 01, 2012
Resource and Tips of Stata
Resource and Tips of Stata
- Stata Documentation
- UCLA Statistical Computing: Stata
- SDAS: Stata Tech Tips
- University of Wisconsin: Statistical Computing
- Blog: Stata tips of Stata Journal
- Stata: Q & A Survey data analysis
- Stata News: in the spotlight
- Commands related to find/search the variables: -ds-, -lookfor-
- Programming
- Blog: Stata programming
- Blog: Useful and Interesting User-written ado Programs/packages
- Blog: Recycle/use returned results in Stata
- Blog: Stata undocumented commands and options
- Blog: Stata: Output and reuse the estimates of a histogram
- Blog: Stata: Output the results into text files
- Blog: Stata: Output the results into Excel tables
- UCLA: Perform the likelihood ratio, Wald, and Lagrange multiplier (score) test in Stata
- Blog: Get predicted incidence rate using -poisson- of Stata
- Blog: Matrix in Stata; Using Mata to work more effectively with Stata: A tutorial; A Beginner's Guide to Matrix algebra and Matrix Linear Regression Using Stata (Mata)
- Blog: Trend analysis in Stata
- Blog: Get rates by multiple variables for complex sampling designed data
- Blog: Build complicated expressions the easy way
- Blog: Function vs. extended function & -generate- vs. -egen-
- Blog: Chow test to determine whether data can be pooled together
- Blog: How to get predicted incidence rate using -poisson- of Stata
- Blog: Test significance of interactions of categorical variables
- Blog: How to calculate the confidence interval of incidence rate under the Poisson distribution
- Blog: Generate composite categorical variables and indicate/dummy variables, convert a continuous variable into a categorical variable
- Blog: Do 'lincom' after a three-way 'margins'
- Blog: Can 'margins' be used after 'mi estimate'
- Blog: Why I get error message, when using 'margins' for complex sampling data
- Blog: Get orthogonal polynomial coefficient/vector/codes.
- Blog: How to compare regression coefficients between models using -suest-.
- Blog: Do Bootstrap/Jackknife in Stata
- UIUC: An example of Delta-Method and Bootstrap Techniques - Econometrics at the University of Illinois
- Blog: Get out-of-sample file predictions
- Blog: Stata display system date
- Blog: Survival analysis using Stata
- Delta method: Margins using the delta method (Stata), Computation of Standard Errors, Wikipedia, Gary White, R (UCLA, Stata like packages: margins, modmarg)
Subscribe to:
Posts (Atom)