Learn R Programming

SOP (version 1.0-1)

print.sop: Print method for sop objects

Description

Print method for sop objects

Usage

# S3 method for sop
print(x, ...)

Value

Prints some summary statistics of the fitted model.

Arguments

x

an object of class sop as produced by sop()

...

further arguments passed to or from other methods. Not yet implemented.

See Also

sop

Examples

Run this code
library(SOP)
# Simulate the data
set.seed(123)
n <- 1000
sigma <- 0.5
x <- runif(n)
f0 <- function(x) 2*sin(pi*x)
f <- f0(x)
y <- f + rnorm(n, 0, sigma)
dat <- data.frame(x = x, y = y)

# Fit the model
m0 <- sop(formula = y ~ f(x, nseg = 10), data = dat)
m0

Run the code above in your browser using DataLab