An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20030506/79e9b3a9/attachment.pl
Questons about R capabilities
7 messages · Howard Alper, Spencer Graves, Duncan Murdoch +4 more
Regarding the second question, did you try "library(mass)" before your mvrnorm command? Regarding the first question: I'm not certain what you want. The function "lm", for example, minimizes the sums of squares of deviations between observed and predicted. This also maximizes the likelihood assuming the deviations between observed and the "true model" are independent normal variates with constant variance. Can you express your model in terms of a probability density function for your observations with the model related in some way to parameters of that probability density? hope this helps. spencer graves
Howard Alper wrote:
Hello, 1) I am interested in performing a limited-dependent variable linear regression. By this I mean a classical linear regression, but for the case where the values of the dependent variable cannot vary from -infinity to +infinity, but are truncated and so are between two finite limits L1 and L2. Does R1.7 have this capability? If so what is (are) the relevant command(s)? 2) I am also interested in sampling from a multivariate normal distribution. I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized. Is there something I must do to enable this command, or is it not available in version 1.7? Thanks, Howard [[alternate HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Tue, 06 May 2003 15:27:20 -0400, you wrote in message <seb7d46c.048 at healthsmtp.nycnet>:
Hello, 1) I am interested in performing a limited-dependent variable linear regression. By this I mean a classical linear regression, but for the case where the values of the dependent variable cannot vary from -infinity to +infinity, but are truncated and so are between two finite limits L1 and L2. Does R1.7 have this capability? If so what is (are) the relevant command(s)?
I don't think that's built in, but it's always worth looking at the contributed packages on cran.r-project.org just in case. There are general purpose likelihood maximizers (nlm, optim).
2) I am also interested in sampling from a multivariate normal distribution. I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized. Is there something I must do to enable this command, or is it not available in version 1.7?
When the help says "mvrnorm(MASS)", that means that the function is in the package called "MASS". You need to execute library(MASS) to get that function loaded onto the search path. You can see which packages are already there by executing search() Duncan Murdoch
Duncan Murdoch wrote:
On Tue, 06 May 2003 15:27:20 -0400, you wrote in message <seb7d46c.048 at healthsmtp.nycnet>: ...
2) I am also interested in sampling from a multivariate normal distribution. I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized. Is there something I must do to enable this command, or is it not available in version 1.7?
When the help says "mvrnorm(MASS)", that means that the function is in the package called "MASS". You need to execute library(MASS) to get that function loaded onto the search path. You can see which packages are already there by executing search() Duncan Murdoch
You can also sample a multivariate normal distribution using rmvnorm from a contributed package "mvtnorm". Execute library(mvtnorm) before using it. Paul Peng
Just a note:
"Spencer" == Spencer Graves <spencer.graves at pdf.com>
on Tue, 06 May 2003 12:51:41 -0700 writes:
Spencer> Regarding the second question, did you try
Spencer> "library(mass)" before your mvrnorm command?
it's an accident that this works -- on Windows only.
It will stop working in some future versions of R.
As Duncan Murdoch mentioned in his answer on this thread, the
correct command to activate the recommended package MASS is
library(MASS)
## ^^^^ capitalized.
As you all have learned, case does matter in the S language.
Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27
ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND
phone: x-41-1-632-3408 fax: ...-1228 <><
1 day later
You can use the optim() function in MASS to optimize a loglikelihood function. For inspiration on the form of the loglikelihoodfunction in your case, you may consult G.S. Maddala "Limited dependent variables in econometrics" 1983 (the title may not be completely correct). Ruud *********** REPLY SEPARATOR ***********
On 5/6/2003 at 3:27 PM Howard Alper wrote:
Hello, 1) I am interested in performing a limited-dependent variable linear regression. By this I mean a classical linear regression, but for the case where the values of the dependent variable cannot vary from -infinity to +infinity, but are truncated and so are between two finite limits L1 and L2. Does R1.7 have this capability? If so what is (are) the relevant command(s)? 2) I am also interested in sampling from a multivariate normal distribution. I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized. Is there something I must do to enable this command, or is it not available in version 1.7? Thanks, Howard [[alternate HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Just one note, optim() is in the `base' package. You do not need to load `MASS' (although you may want to read the book). -roger _______________________________ UCLA Department of Statistics http://www.stat.ucla.edu/~rpeng
On Thu, 8 May 2003, Ruud H. Koning wrote:
You can use the optim() function in MASS to optimize a loglikelihood function. For inspiration on the form of the loglikelihoodfunction in your case, you may consult G.S. Maddala "Limited dependent variables in econometrics" 1983 (the title may not be completely correct). Ruud *********** REPLY SEPARATOR *********** On 5/6/2003 at 3:27 PM Howard Alper wrote:
Hello, 1) I am interested in performing a limited-dependent variable linear regression. By this I mean a classical linear regression, but for the case where the values of the dependent variable cannot vary from -infinity to +infinity, but are truncated and so are between two finite limits L1 and L2. Does R1.7 have this capability? If so what is (are) the relevant command(s)? 2) I am also interested in sampling from a multivariate normal distribution. I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized. Is there something I must do to enable this command, or is it not available in version 1.7? Thanks, Howard [[alternate HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help