simdata: Simulate data

Description Usage Arguments Value Source Examples

View source: R/simdata.R View source: R/functions.R

Description

This function simulates data for the mate preference model described by Clancey, Johnson, Harmon, and Hohenlohe (2021).

Usage

1
simdata(alpha, delta, mx, my, sx, sy, np, nx, ny, gamma = 1)

Arguments

alpha

Value of the alpha parameter.

delta

Value of the delta parameter.

mx

Value of the mean of the X trait.

my

Value of the mean of the Y trait.

sx

Value of the standard deviation of the X trait.

sy

Value of the standard deviation of the Y trait.

np

Number of paired observations of X and Y.

nx

Number of unpaired observations of X.

ny

Number of unpaired observations of Y.

gamma

Value of the gamma parameter (defaults to one).

Value

The function returns a list of four vectors consisting of the paired observations of X and Y (xp and yp, respectively), and the unpaired observations of X and Y (x and y, respectively).

Source

Clancey, E., Johnson, T. R., Harmon, L. J., and Hohenlohe, P. A. Estimation of the strength of mate preference from mated pairs observed in the wild. Unpublished manuscript.

Examples

1
mydata <- simdata(0.5, 0, 50, 52, 1, 1, 100, 50, 50)

erinclancey/matepref documentation built on Dec. 20, 2021, 6:36 a.m.