Sunday, April 6, 2014

xttobit -- Linear Regression Model with Panel-level Random Effects for censored data

xttobit fits random-effects tobit models. There is no command for a parametric conditional fixedeffects model, as there does not exist a sufficient statistic allowing the fixed effects to be conditioned out of the likelihood.


Panel data analysis has three more-or-less independent approches:
1. Independently pooled panels: there are no unique attributes of individuals within the measurement set, and no universal effects across time
2. Random effects model: there are unique, time constant attributes of individuals that are the results of random variation and do not correlate with the individual regressors. This model is adequate if we want to draw inferences about the whole population, not only the examined sample
3. Fixed effects model (or first differenced models): there are unique attributes of individuals that are not the results of random variation and that do not vary across time. Adequate if we want to draw inferences only about the examined individuals. Also known as "least squares dummy variable model"


y_{it}=x_{it}beta + u_i + e_it

u_i is the random effects
e_it is the individual effect

. xi: xttobit Contribution Period Belief AmountInvested Cutoff RandomDraw realized econm
> ajor econyear if Treatment==4, ll(0) ul(20)


Random-effects tobit regression                 Number of obs      =       320
Group variable: Subject                         Number of groups   =        16

Random effects u_i ~ Gaussian                   Obs per group: min =        20
                                                               avg =      20.0
                                                               max =        20

                                                Wald chi2(8)       =    372.07
Log likelihood  = -643.86478                    Prob > chi2        =    0.0000

------------------------------------------------------------------------------
Contribution |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      Period |  -.3714078   .0859276    -4.32   0.000    -.5398229   -.2029927
      Belief |   .8871966   .1082666     8.19   0.000      .674998    1.099395
AmountInve~d |   .4972489   1.099413     0.45   0.651    -1.657561    2.652059
      Cutoff |  -.1031474   .0144602    -7.13   0.000    -.1314888   -.0748059
  RandomDraw |   .0298226   .0128297     2.32   0.020     .0046769    .0549683
    realized |    1.19617   1.115385     1.07   0.284    -.9899439    3.382284
   econmajor |  -.1037135   4.025793    -0.03   0.979    -7.994123    7.786696
    econyear |   -1.11204   1.565532    -0.71   0.478    -4.180426    1.956345
       _cons |   4.846538   4.027966     1.20   0.229    -3.048129    12.74121
-------------+----------------------------------------------------------------
    /sigma_u |   4.153189   .9255023     4.49   0.000     2.339238     5.96714
    /sigma_e |     4.6622   .2652641    17.58   0.000     4.142292    5.182109
-------------+----------------------------------------------------------------
         rho |   .4424506   .1130577                      .2400784    .6614899
------------------------------------------------------------------------------

  Observation summary:        94  left-censored observations
                             185     uncensored observations

                              41 right-censored observations

The output includes the overall and panel-level variance components (labeled sigma e and sigma u, respectively) together with rho, which is the percent contribution to the total variance of the panel-level variance component.

When rho is zero, the panel-level variance component is unimportant, and the panel estimator is not different from the pooled estimator. A likelihood-ratio test of this is included at the bottom of the output. This test formally compares the pooled estimator (tobit) with the panel estimator.

Saturday, April 5, 2014

The danger of high blood sugur

Diabetes, is a group of metabolic diseases in which a person has high blood sugar.

Diabetes is due to either the pancreas not produce enough insulin, or because cells of the body do not respond properly to the insulin that is produced. There are three main types of diabetes mellitus:

1. Type 1 DM results from the body's failure to produce insulin.

2. Type 2 DM results from insulin resistance, a condition in which cells fail to use insulin properly, sometimes also with an absolute insulin deficiency.

Consumption of sugar-sweetened drinks in excess is associated with an increased risk. The type of fats in the diet are also important, with saturated fats and trans fatty acids increasing the risk, and polyunsaturated and monounsaturated fat decreasing the risk. Eating lots of white rice appears to also play a role in increasing risk. A lack of exercise is believed to cause 7% of cases.

Why are high blood sugar levels bad for you? Glucose is precious fuel for all the cells in your body -- when it's present at normal levels. But persistently high sugar levels behave like a slow-acting poison.

High sugar levels slowly erode the ability of cells in the pancreas to make insulin. The pancreas overcompensates, though, and insulin levels remain overly high. Gradually, the pancreas is permanently damaged.

All the excess sugar is modified in the blood. The elevated sugar in the blood causes changes that lead to atherosclerosis, a hardening of the blood vessels.

Because high sugar levels are everywhere, the body can be damaged anywhere. Damage to blood vessels, in particular, means no area is safe from too much sugar. High sugar levels and damaged blood vessels cause the multitude of complications that can come with diabetes

3. Gestational diabetes, is the third main form and occurs when pregnant women without a previous diagnosis of diabetes develop a high blood glucose level.

Artificial sweetener increases the likelihood of gaining weight

Experiments have found that sweet taste, regardless of its caloric content, enhances your appetite. Aspartame has been found to have the most pronounced effect, but the same applies for other artificial sweeteners, such as acesulfame potassium and saccharin.

The reason why glucose or sucrose (table sugar) tends to lead to lower food consumption compared to non-caloric artificial sweeteners is because the calories contained in natural sweeteners trigger biological responses to keep your overall energy consumption constant. This was again evidenced in a study

In essence, real sugar allows your body to accurately determine that it has received enough calories, thereby activating satiety signaling. Without the calories, your appetite is activated by the sweet taste, but as your body keeps waiting for the calories to come, sensations of hunger remain.

http://articles.mercola.com/sites/articles/archive/2012/12/04/saccharin-aspartame-dangers.aspx#!

Friday, April 4, 2014

The Key for a Good Experimental Paper

Have a strong alternative hypothesis. Write about this alternative hypothesis in the introduction. An experimental design is interesting only when multiple outcomes can happen. Get the readers interested in the multiple outcomes.

Irwin–Hall distribution

In probability and statistics, the Irwin–Hall distribution, named after Joseph Oscar Irwin and Philip Hall, is probability distribution for a random variable defined as sum of a number of independent random variables, each having a uniform distribution.[1] For this reason it is also known as the uniform sum distribution.

Sunday, March 30, 2014

What statistical analysis should I use?

Number of
Dependent
Variables
Nature of
Independent
Variables
Nature of Dependent
Variable(s)
Test(s)
1
 0 IVs
(1 population)
interval & normal
one-sample t-test
ordinal or interval
one-sample median
categorical
 (2 categories)
binomial test
categorical
 Chi-square goodness-of-fit
 1 IV with 2 levels
(independent groups)
interval & normal
2 independent sample t-test
 ordinal or interval
Wilcoxon-Mann Whitney test
 categorical
 Chi- square test
Fisher's exact test
1 IV with 2 or more levels (independent groups)
interval & normal
one-way ANOVA
ordinal or interval
Kruskal Wallis
categorical
Chi- square test
1 IV with 2 levels
(dependent/matched groups)
interval & normal
paired t-test 
 ordinal or interval
Wilcoxon signed ranks test 
 categorical
McNemar
1 IV with 2 or more levels
(dependent/matched groups)
interval & normal
one-way repeated measures ANOVA
ordinal or interval
Friedman test
categorical
repeated measures logistic regression
2 or more IVs
(independent groups)
interval & normal
factorial ANOVA
ordinal or interval
ordered logistic regression
categorical
factorial
logistic regression
1 interval IV
interval & normal
correlation 
simple linear regression
ordinal or interval
 non-parametric correlation
categorical
simple logistic regression
1 or more interval IVs and/or
1 or more categorical IVs
interval & normal
multiple regression
analysis of covariance
categorical
multiple logistic regression
discriminant analysis
2 or more
1 IV with 2 or more levels
(independent groups)
interval & normal
one-way MANOVA
2 or more
2 or more
interval & normal
multivariate multiple linear regression
2 sets of
2 or more
0
interval & normal
canonical correlation
2 or more
0
interval & normal
factor analysis
Number of
Dependent
Variables
Nature of
Independent
Variables
Nature of Dependent
Variable(s)
Test(s)

Source: http://www.ats.ucla.edu/stat/stata/whatstat/
http://www.ats.ucla.edu/stat/stata/whatstat/whatstat.htm#1sampt


In statistics, Spearman's rank correlation coefficient or Spearman's rho, named after Charles Spearman and often denoted by the Greek letter  (rho) or as , is a nonparametric measure of statistical dependence between two variables. It assesses how well the relationship between two variables can be described using a monotonic function. If there are no repeated data values, a perfect Spearman correlation of +1 or −1 occurs when each of the variables is a perfect monotone function of the other.


Risk vs Uncertainty

Risk applies to situations where we do not know the outcome of a given situation, but can accurately measure the odds. Uncertainty, on the other hand, applies to situations where we cannot know all the information we need in order to set accurate odds in the first place.