Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add_variable

add_variable adds columns to the data matrix


Description

add_variable adds columns to the data matrix

Usage

add_variable(data = data, dname = "chc", weights = NULL)

Arguments

data

data.frame, if dname=="chc" columns "chc_i" has to be in the data.

dname

if dname=="chc" (dummy for chosen alternative) dummy for the choice alternative added, if "weights" weights added

weights

Matrix with weights to be added to the data

Value

data.frame

Examples

chc <- c(1,2,1,4,3,1,4)
data <- data.frame(choice=chc, x=rnorm(length(chc)), y=rnorm(length(chc)))
add_variable(data, dname="chc")
ww <- c(1,1,1,2,2,2,3)
add_variable(data, dname="weights", weights=ww)

nmm

Nonlinear Multivariate Models

v0.9
GPL (>= 2)
Authors
Simona Jokubauskaite [aut, cre], Reinhard Hoessinger [aut], Friedrich Leisch [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.