Jacob Nabe-Nielsen
2009-Aug-12 09:33 UTC
[R] Simulating points from GLM corresponding to new x-values
Dear List, Does anyone know how to simulate data from a GLM object correponding to values of the independent (x) variable that do not occur in the original dataset? I have tried using simulate(), but it generates a new value of the dependent variable corresponding to each of the original x-values, which is not what I need. Ideally I whould like to simulate new values for GLM objects both with family="gaussian" and with family="binomial". Thanks in advance, Jacob Jacob Nabe-Nielsen, PhD, MSc Scientist -------------------------------------------------- Section for Climate Effects and System Modelling Department of Arctic Environment National Enviornmental Research Institute Aarhus University Frederiksborgvej 399, Postbox 358 4000 Roskilde, Denmark email: nabe@dmu.dk fax: +45 4630 1914 phone: +45 4630 1944 [[alternative HTML version deleted]]
Clifford Long
2009-Aug-12 11:11 UTC
[R] Simulating points from GLM corresponding to new x-values
Would the "predict" routine (using 'newdata') do what you need? Cliff Long Hollister Incorporated On Wed, Aug 12, 2009 at 4:33 AM, Jacob Nabe-Nielsen<jacobnabe at me.com> wrote:> Dear List, > > Does anyone know how to simulate data from a GLM object correponding > to values of the independent (x) variable that do not occur in the > original dataset? > > I have tried using simulate(), but it generates a new value of the > dependent variable corresponding to each of the original x-values, > which is not what I need. Ideally I whould like to simulate new values > for GLM objects both with family="gaussian" and with family="binomial". > > Thanks in advance, > Jacob > > Jacob Nabe-Nielsen, PhD, MSc > Scientist > ?-------------------------------------------------- > Section for Climate Effects and System Modelling > Department of Arctic Environment > National Enviornmental Research Institute > Aarhus University > Frederiksborgvej 399, Postbox 358 > 4000 Roskilde, Denmark > > email: nabe at dmu.dk > fax: +45 4630 1914 > phone: +45 4630 1944 > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Seemingly Similar Threads
- help on plotting series with different x-axis values on a graph with one x-axis
- Importing TIFF files into a R matrix
- How to join data.frames and vectors of different length, in an inteligent way?
- Using checkpassword to block ips?
- Aggregate function for comparison stats