An easy way to get Fama-French market and risk-free rate 
/////////////////////////////////

 Step 1: type
         .uu 

 Step 2: type the following command to see the instruction 
         .showff3Monthly

 Step 2B: type the following command to see the daily data 
         .showff3Daily 

/////////////////////////////////

Payoff for a call 
//////////////////////////////
For a call option buyer, the payoff function is:

    payoff(call) = Max(sT-x,0)

   sT is the terminal price
    T is the maturity date
    x is the exercise price (strike price)

For example, if the stock terminal stock price is $25 and exercise price is $10
   then the payoff of a call option buyer is 

     Max(25-10,0) = max(15, 0) = 15

  If the stock terminal stock price is $5 and exercise price is $10
   then the payoff of a call option buyer is 

     Max(5-10,0) = max(-5, 0) = 0

 Since this is a zero sum gain, the payoff of a call option seller is

   payoff(call seller)= - payoff(call buyer) = - Max(sT-x,0)

//////////////////////////////

How to run a linear regression?
/////////////////////////////////
the function used is called lm(y~x)

  set.seed(123)

  # note that if we choose the same set of random seed
  # we would get the same set of random numbers

 x<-seq(1,10,by=0.2)
 a<-2
 beta=3
 n<-length(x)
 y=a+beta*x +rnorm(n)
 plot(x,y)

 lm(y~x)
 summary(lm(y~x))

> summary(lm(y~x))

Call:
lm(formula = y ~ x)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.01284 -0.65420 -0.03916  0.65827  2.14669 

Coefficients:
              Estimate Std. Error t value   Pr(>|t|)    
(Intercept)  2.06650    0.32731   6.314    1.17e-07 ***
x            2.99539    0.05359  55.892    < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.9651 on 44 degrees of freedom
Multiple R-squared:  0.9861,    Adjusted R-squared:  0.9858 
F-statistic:  3124 on 1 and 44 DF,  p-value: < 2.2e-16

/////////////////////////////////

payoff function for a put option 
//////////////////////////////
For a put option buyer, the payoff function is:

    payoff(call) = Max(x-sT,0)

   sT is the terminal price
    T is the maturity date
    x is the exercise price (strike price)

For example, if the stock terminal stock price is $25 and exercise price is $10
   then the payoff of a put option  buyer is 

     Max(x-sT,0) = max(10-25,0) = max(-15, 0) = 0

  If the stock terminal stock price is $5 and exercise price is $10
   then the payoff of a put option buyer is 

     Max(10-5,0) = max(5, 0) = 5

 Since this is a zero-sum game, the payoff of a put option seller is

   payoff(put seller)= - payoff(put buyer) = - Max(x-sT,0)

//////////////////////////////