# plot.semsfa: Default SEMSFA plotting In semsfa: Semiparametric Estimation of Stochastic Frontier Models

## Description

This function plots the semiparametric/nonparametric intermediate model object estimated in the first step of the algorithm and, if `efficiencies.semsfa()` is esecuted, individual point estimate of the efficiency.

## Usage

 ```1 2``` ```## S3 method for class 'semsfa' plot(x, g.type, mod, ...) ```

## Arguments

 `x` a `semsfa` object as returned from `semsfa()` or `efficiencies.semsfa()` `g.type` a character string indicating the type of plot. Possible values are: "reg" to plot the semiparametric/nonparametric model object estimated in the first step from `semsfa()`, "eff" to draw point estimate of the efficiency obtained from `efficiencies.semsfa()` `mod` a character string indicating the plot style for g.type="eff": "hist" for histogram and "dens" for density plot `...` further arguments passed to plot.default.

## Value

The function simply generates plots.

## Author(s)

Giancarlo Ferrara and Francesco Vidoli

`semsfa`, `efficiencies.semsfa`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32``` ```set.seed(0) n<-200 #generate data x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) o<-semsfa(y~s(x),dati,sem.method="gam") #the following plot will be like that generated by plot.gam plot(o,g.type="reg") #adding a covariate z<- runif(n, 1, 2) dati\$z<-z #first-step: kernel, second-step: fan (default) o<-semsfa(y~x+z,dati,sem.method="kernel") #the plot will be like that generated by a plot.npreg ## Not run: plot(o,g.type="reg") #calculate efficiencies ... a<-efficiencies.semsfa(o) plot(a,g.type="eff",mod="dens") #adding further parameters as for plot.default: col, main, xlim, ... plot(a,g.type="eff",mod="dens",col=2,main="Density Efficiency",xlim=c(0,1),xlab="Efficiency") ```

### Example output

```Loading required package: mgcv
This is mgcv 1.8-17. For overview type 'help("mgcv-package")'.
Nonparametric Kernel Methods for Mixed Datatypes (version 0.60-3)
[vignette("np",package="np") an overview]
[vignette("entropy_np",package="np") an overview of entropy-based methods]

Multistart 1 of 2 |
Multistart 1 of 2 |
Multistart 1 of 2 |
Multistart 1 of 2 /
Multistart 1 of 2 |
Multistart 1 of 2 |
Multistart 2 of 2 |
Multistart 2 of 2 |
Multistart 2 of 2 /
Multistart 2 of 2 |
Multistart 2 of 2 |

```

semsfa documentation built on April 21, 2018, 1:05 a.m.