fixed: fixed effect function

Description Usage Arguments Value Author(s) Examples

View source: R/Paneldata.R

Description

fixed effect function

Usage

1
fixed(y, x, n, t)

Arguments

y

vector of dependent variable

x

matrix of independents variables

n

number of sections

t

times per section

Value

Coefficients a named vector of coefficients

vcov covariance matrix of coefficients

df the degree of freedom

Author(s)

Zaghdoudi Taha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pib<-as.matrix(c(12,3,4,0.4,0.7,5,0.7,0.3,0.6,89,7,8,45,7,4,5,0.5,5),nrows=18,ncols=1)
tir<-as.matrix(c(12,0.3,4,0.4,7,12,3.0,6.0,45,7.0,0.8,44,65,23,4,6,76,9),nrows=18,ncols=1)
inf<-as.matrix(c(1.2,3.6,44,1.4,0.78,54,0.34,0.66,12,0.7,8.0,12,65,43,5,76,65,8),nrows=18,ncols=1)
npl<-as.matrix(c(0.2,3.8,14,2.4,1.7,43,0.2,0.5,23,7.8,88,36,65,3,44,65,7,34),nrows=18,ncols=1)
# create data frame
mdata<-data.frame(p=pib,ti=tir,int=inf,np=npl)
# create the designed matrix for the model
d<-matrix(c(mdata$p,mdata$int,mdata$np),18, 3)
# Fit a fixed model
fx<-fixed(mdata$p,d,n=6,t=3)
fx

Example output

$coefficients
              [,1]
[1,]  1.000000e+00
[2,] -8.326673e-17
[3,] -1.110223e-16

$vcov
              [,1]          [,2]          [,3]
[1,]  4.381833e-32 -7.959139e-33  1.163005e-32
[2,] -7.959139e-33  3.414647e-32 -1.338142e-32
[3,]  1.163005e-32 -1.338142e-32  3.248868e-32

$df
[1] 15

Paneldata documentation built on May 2, 2019, 3:47 p.m.