Displaying 20 results from an estimated 7000 matches similar to: "New R user looking from help"
2006 Apr 05
2
using latex() in R for Unix
I am using R for Unix and want to make some LaTeX tables. I have
already played around in R for Windows and have succeeded in making
tables that I want using the following code:
latex(Estimates, file='out.tex', rowlabel='',digits=3)
However, when I use this code in Unix, I can never find the file
"out.tex". I assumed that R would send the file to whatever directory
I
2006 Apr 07
1
Referencing variables in a dataframe.
I have a question about how to reference variables in a dataframe.
Normally, after I have read in some Stata data using the following command
all <- read.dta('all.dta')
Whenever I want to use the variable "sat.vr1" in the "all" data frame,
I do so using
all$sat.vr1
However, I'd like to be able to use the sat.vr1 variable without the
"all$" (as well
2006 Apr 07
4
saving estimates from a for loop for later use
Thanks to the help of many on this list, I am now an R user and have
been able to write some functioning code to do matching estimation.
I have two for loops (i in 1:3, and j in 0:2). Within the loops, I
had been creating matrices of relevant estimation coefficents in order
to make lots of LaTeX tables.
Well, now I want to be able to combine the results of many different
estimations from within
2006 Mar 03
3
Two quick questions
Hi all,
1. How to construct a date from three variables year, month, and day,
where all three are integers?
2. I have a dataframe by date and sector. I would like to add-up all
entries for all variable with identical date and sector, replacing the
original entries, i.e. emulate the STATA command "collapse (sum) var1
var2 var3, by(date sector)".
Thank you,
Serguei Kaniovski
2005 Oct 15
2
batch file execution
I am new to R and really like to get a handle of basics in short period of
time. What I am trying to do is get myself a list of must-do's (read in
data, batch execution, delimiters, basic modeling commands) in R as in Stata
or SAS. I am just wondering how to execute a R batch file in RGui. Suppose I
have a script file (like do file in stata, or sas file in SAS) under
c:\whatever.R, how can I
2006 Jan 05
2
Suggestion for big files [was: Re: A comment about R:]
[ronggui]
>R's week when handling large data file. I has a data file : 807 vars,
>118519 obs.and its CVS format. Stata can read it in in 2 minus,but In
>my PC,R almost can not handle. my pc's cpu 1.7G ;RAM 512M.
Just (another) thought. I used to use SPSS, many, many years ago, on
CDC machines, where the CPU had limited memory and no kind of paging
architecture. Files did
2006 Apr 11
3
problems with rounding in output
Perhaps someone will have a solution to my more general problem, but
here is the specific one:
I used the round() function to round some estimates to 3 decimal
places. I then sent put the rounded estimates in a matrix and used
latex() to make a LaTeX table from them. However, in my table, there
are estimtes which only have 2 decimal places. I assume that the third
decimal place in these numbers
2005 Dec 15
1
bug?
> library(foreign)
> da<-read.dta(file.choose())
> da
startdat starttim enddate endtime days hoursmin secused
1 2005-01-11 2 2005-12-15 20.19 NA NA 9
> attributes(da)
$datalabel
[1] "Example of use of date and time functions"
$time.stamp
[1] "15 伿伄伓侢佋伮 2005 20"
$names
[1] "startdat" "starttim"
2006 Apr 14
2
another very simple loop question
I have a dataset with 4 years of students, and normally I want to
estimate things using each individual year, so I have a for loop as
follows
for (i in 1:4){}
However, the only way I know how to calculate estimates using all four
years of data is to put the estimations outside of the loop. Is there
anyway to make a for loop that uses all four years at once, then uses
each individual year?
2006 May 01
2
problem installing Econometrics view
When I try to install hte Econometrics view I get the following error:
CRAN task view Econometrics not available in: install.views("Econometrics")
I have already install the ctv package and loaded it before trying to
install the above...
Any ideas as to what's going on?
2005 Dec 12
3
question about date's
Hi,
Given a frame with calendar date's:
"2005-07-01", "2005-07-02","2005-07-03","2005-07-04","2005-07-05",etc.
I want to extract the following from these dates:
week number
month number
year number
Any ideas how to accomplish this?
Many thanks.
Regards,
Richard
2006 Feb 16
2
looping through tasks
Hi,
I'm moving (slowly) to R from STATA.
I often have need to move through a set of tasks across a series of years.
In this case, you can see that I'm mimicking -reshape- in STATA, but I'm
less interested in the
task than in programming R.
library(foreign)
mydata<-read.dta("z:\example.dta")
for (y in 2000:2002) {
2006 Apr 14
3
The object argument of NextMethod.
My question is when the object argument of NexthMethod be used?
In the following example, weather object argument is used will not
affects the result.
###
foo=function(x) {UseMethod("foo")}
foo.cls1=function(x)
{
x=x+1;class(x)<-"ncls"
NextMethod()
}
foo.ncls=function(x)
{
cat("ncls\n")
}
foo.cls2=function(x)
{
cat("cls2\n");print(x)
}
2005 Jun 13
5
slow loading with lme4
it takes a long time to load the lme4 package.anyone else encounter this problem?
> system.time(library(lme4))
佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜Matrix
佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜lattice
[1] 19.90 0.30 25.56 NA NA
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status Patched
major 2
minor
2006 Feb 22
2
does multinomial logistic model from multinom (nnet) has logLik?
I want to get the logLik to calculate McFadden.R2 ,ML.R2 and
Cragg.Uhler.R2, but the value from multinom does not have logLik.So my
quetion is : is logLik meaningful to multinomial logistic model from
multinom?If it does, how can I get it?
Thank you!
ps: I konw VGAM has function to get the multinomial logistic model
with logLik, but I prefer use the function from "official" R
2006 May 08
1
Panel Data Estimators (within, between, Random Effects estimator)
Dear R Users,
Here is another probelm/question.
I would like to run some panel regressions with R. Therefore I have
combined several time periods of data for different individuals in my
database.
I have already run pooled OLS but I would need to calculate a Fixed
Effects Estimator (within estimator). Unfortunately I couldn't find
anything like that in the RSearch and I suppose that lme
2006 Apr 07
3
strange matrix behaviour: is there a matrix with one row?
Consider this:
> y <- matrix(1:8, ncol=2)
> is.matrix(y[-c(1,2),])
[1] TRUE
> is.matrix(y[-c(1,2,3),])
[1] FALSE
> is.matrix(y[-c(1,2,3,4),])
[1] TRUE
It seems like an inconsistent behaviour:
- with 2 or more rows we have a matrix
- with 1 row we do not have a matrix and
- with 0 rows we have a matrix again
I just stumbled on this behaviour, because I had a problem
with my
2005 Nov 27
2
multilevel models and sample size
It is not a pure R question,but I hope some one can give me advices.
I want to use analysis my data with the multilevel model.The data has 2 levels---- the second level has 52 units and each second level unit has 19-23 units.I think the sample size is quite small,but just now I can't make the sample size much bigger.So I want to ask if I use the multilevel model to analysis the data set,will
2005 Aug 01
6
converting stata's by syntax to R
I am struggling with migrating some stata code to R. I have a data
frame containing, sometimes, repeat observations (rows) of the same
family. I want to keep only one observation per family, selecting
that observation according to some other variable. An example data
frame is:
# construct example data
fam <- c(1,2,3,3,4,4,4)
wt <- c(1,1,0.6,0.4,0.4,0.4,0.2)
keep <- c(1,1,1,0,1,0,0)
2005 Oct 15
2
how to import such data to R?
the data file has such structure:
1992 6245 49 . . 20 1
0 0 8.739536 0 . . .
. . . . . "alabama"
. 0 .
1993 7677 58 . . 15 1
0 0