Displaying 20 results from an estimated 1000 matches similar to: "Writing and running a R program"
2003 Oct 22
1
passing a variable (containing the value of the argument) to a function
My previous question put in a simpler way:
How would I pass a value of a variable to a function such as
lm(Effect1~Trt*Dose, data = x, contrasts = list(Trt = contr.sum, Dose =
contr.sum))?
Here, 'Effect' is a column name in my data matrix, and I want "Effect1" to
be replaced by "Effect2" and so on (my other column names in the data
frame) for successive anova
2003 Oct 21
1
Type III Sum of Squares Calculation
HI All:
Can anyone give me the formulae/steps for calculating the type III sum of
squares for an unbalanced 2-way ANOVA design? Eg. we are looking at 8
treatments x 4 doses, with unequal numbers of replications within the
groups. I really need the stepwise calculation, as I would try to put it
in my own code (possibly in Visual Basic) to automate the task.
Thanks very much.
Karth.
2003 Sep 24
5
splitting clusters
Hi All:
I am clustering 500 genes using hclust of R. Visualizing cluster
membership becomes difficult with so many genes in each cluster...Is there
a way of printing the dendrogram in multiple pages so that I can clearly
see what is in each cluster?
Thanks in advance.
Karthi.
2003 Feb 20
2
is.numeric
Hi,
I have a vector, which contains both strings and numbers, e.g.
> foo <- c("str1",1234,"str2",0.9876)
I want to know if a distinct element of the vector is a string or a number and
took "is.numeric", but
> is.numeric(foo[2])
[1] FALSE
because R treats the numbers in a mixed vectors as strings:
> foo
[1] "str1" "1234"
2003 Sep 26
2
checking generic/method consistency
Hi,
I wrote a package for linear programming and want to submit it to CRAN.
Since the package 'quadprog' has a function with the name 'solve.QP' to
perform Quadratic Programming, I named my (main) function 'solve.LP'.
However 'R CMD check' gives one warning:
* checking generic/method consistency ... WARNING
solve:
function(a, b, ...)
solve.LP:
2003 Oct 01
3
problem downloading Red Hat R-1.7.1-1.i386.rpm
System info:
Red Hat 9.0
R Version 1.7.0
ESS 5.1.21
Emacs 21.2.1
-------------------
Colleagues
At work I've had to migrate from Mandrake 9.1 to Red Hat 9.0 and I'm
reinstalling R. I am having a problem downloading from
R-1.7.1-1.i386.rpm from /bin/linux/redhat/9/i386. Basically the download
does not complete. I am using mozilla, and when I click on the link the
screen corrupts with
2004 Nov 29
3
systemfit - SUR
Hello to everyone,
I have 2 problems and would be very pleased if anyone can help me:
1) When I use the package "systemfit" for SUR regressions, I get two
different variance-covariance matrices when I firstly do the SUR
regression ("The covariance matrix of the residuals used for
estimation") and secondly do the OLS regressions. In the manual for
"systemfit" on page
2004 Nov 01
5
make apply() return a list
Hi,
I have a dataframe (say myData) and want to get a list (say myList) that
contains a matrix for each row of the dataframe myData. These matrices are
calculated based on the corresponding row of myData. Using a for()-loop to do
this is very slow. Thus, I tried to use apply(). However, afaik apply() does
only return a list if the matrices have different dimensions, while my
matrices have
2005 May 22
3
constraints
Is there a package in R that handles general linear (in-)equality + box
constrained optimization?
If it is not there, could anyone advise me which way to go?
And/or point me to packages that solve these problems partially?
best, ingmar
--
Ingmar Visser
Department of Psychology, University of Amsterdam
Roetersstraat 15, 1018 WB Amsterdam
The Netherlands
http://users.fmg.uva.nl/ivisser/
tel:
2004 Nov 16
3
How to remove x, y labels from a plot
Hi there,
I need to plot an illustrative figure without ticks, x, y labels in R. I
managed to get the ticks removed, but had no luck with x, y labels.
Any suggestions would be much appreciated.
Jin Li
[[alternative HTML version deleted]]
2007 Oct 30
2
Splitting up the micEcon package?
Dear R Users:
The functions of our "micEcon" package [1,2] can be subdivided into three
categories:
- microeconomic demand and firm models
- sample selection models (mainly selection())
- routines for (likelihood) maximisation (e.g. maxLik(), maxNR(), maxBHHH())
(mainly used for ML estimation of sample selection models)
Although sample selection models are often used in
2003 Oct 13
4
help with gsub and grep functions
Hi all,
Let Names a vector of chatacters. For example,
> Names
[1] "g 604 be-0 -p1 (602 matches)" "g 606 Phli-0 -p2 (517 matches)"
[3] "g 608 alu-0 (659 matches)"
I try to use gsub or grep functions for two problems :
1. First, I would like to delete all the characters between parentheses.
[1] "g 604 be-0 -p1" "g 606 be-0 -p2"
[3] "g
2005 Apr 26
2
writing a data frame in excel format
Hello
I know how read a file in excel format into a R data frame using the
RODBC library, but I don't know how write a R data frame in excel
format. I don't understand the instructions from RODBC user manual.
To read an excel file I use.
library(RODBC);
conex<-odbcConnectExcel("fis_quim.xls");
sqlTables(conex);
data<-sqlFetch(conex,"hoja1");
Suppose I
2006 Sep 28
2
R CMD build when the package name is different from the directory name
Hi,
I was really happy when I saw that in R version 2.3.0 "R CMD check" works for
packages whose package name is different from the directory name in which it
is located (see http://cran.r-project.org/src/base/NEWS).
Now, I can have branches of my packages in directories like
"[...]/branches/<version number>/", while I had to use
"[...]/branches/<version
2004 Aug 25
1
License for including datasets in packages
Dear All,
I would like to publish a function for 'heckit' estimations together with two
examples from Greene's and Wooldridge's econometric textbooks.
These examples use the dataset of Mroz (1987) that is also available in John
Fox' "car" package. However, not all variables that are used in my examples
are available in the "car" package. Therefore, I
2004 Mar 16
2
R CMD check warning on predict.systemfit
Hi,
I added a new function "predict.systemfit" to our package "systemfit" to make
it closer to other packages (e.g. lm). Now "R CMD check" complains that the
generic function "predict" has only the argument "object", while our function
"predict.systemfit" has more arguments. However, the function "predict.lm"
has also more
2004 Oct 04
7
Strange Matrix Multiplication Behaviour
Hi there fellow R-users,
Im seeing some strange behaviour when I multiply a vector by a matrix
Here is my script:
> tr
1 2 3 4 5 6
0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667
>
> ex1
a b c d e f
1 0.2309579 -3.279045 -0.6694697 -1.1024404 0.2303928 -1.5527404
2
2005 Nov 22
3
make check fails for R 2.3.0 (PR#8343)
Full_Name: Arne Henningsen
Version: 2.3.0, 2005-11-21, i686-pc-linux-gnu
OS: SuSE Linux 9.0, Kernel 2.4.21
Submission from: (NULL) (134.245.140.242)
I did not find any problems in "./configure" and "make", but "make check"
fails:
make[4]: Entering directory `/home/suapm095/Download/R-devel/tests/Examples'
collecting examples for package 'base' ...
2005 Dec 02
3
masked from package:base?
I am confused by the following description in
http://www.maths.lth.se/help/R/.R/library/systemfit/html/hausman.systemfit.html
what does the "Not run" mean? if we do not load systemfit, how can we run
the following code?
## Not run: library( systemfit )
data( kmenta )
attach( kmenta )
...
I install the package of systemfit, and run the code.
I got the warning:
> library( systemfit
2006 Feb 17
1
Heckman regression / adjustment for standard errors?
Hello folks,
I am trying to estimate the two-step Heckman regression model. I would like to make an adjustment for intragroup correlations. Stata can implement this with the "cluster" option, but I am really hoping to stick with R. It seems that the micEcon package is the primary source for this two-step regression model (i.e., heckit), but I can't find a way to make the