[R] Generating random data with non-linear correlation between two variables
Muhammad Bilal
Muhammad2.Bilal at live.uwe.ac.uk
Fri Apr 8 20:57:24 CEST 2016
Hi All,
I am new to R and don't know how to achieve it.
I am interested in generating a hypothetical dataframe that is consisted of say two variables named v1 and v2, based on the following constraints:
1. The range of v1 is 500-1500.
2. The mean of v1 is say 1100
3. The range of v2 is 300-950.
4. The mean of v2 is say 400
5. There exists a positive trend between these two variables, meaning that as v1 increases, v2 be also increase.
6. But the trend should be slightly non-linear. i.e., curved line.
Is it possible to automatically generate through functions like rnorm.
Any help will be highly appreciated.
Many Thanks and
Kind Regards
--
Muhammad Bilal
Research Assistant and Doctoral Researcher,
Bristol Enterprise, Research and Innovation Centre (BERIC),
University of the West of England (UWE),
Frenchay Campus,
Bristol,
BS16 1QY
muhammad2.bilal at live.uwe.ac.uk<mailto:olugbenga2.akinade at live.uwe.ac.uk>
[[alternative HTML version deleted]]
More information about the R-help
mailing list