Displaying 20 results from an estimated 20000 matches similar to: "sum of squares function"
2011 Oct 12
3
trace an Rd conversion error in R cmd check
Hi All,
Apologies if this is a very naive question. Is there a way to see the
particular Rd file being processed right before a warning/error
occurs? As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}). I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex
2011 Nov 08
2
NAMESPACES for data only packages
the NEWS file for R-devel says
*
Even data-only packages without *R* code need a namespace and so may
need to be installed under *R* 2.14.0 or later.
but what should this contain? Can it simply be an empty NAMESPACE
file? I assume that data does not have to
be exported.
-Michael
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University
2011 Apr 26
1
Least Squares Method
Hi everyone,
I am running the 'gls' command (least squares method) for a number of data
out of which many are zeros. I strongly believe that the output is wrong and
I think that this is due to the large number of zero values included in my
dataset.
I would like to ask if there is a command that would allow me to run the gls
command disregarding all the zero values?
Thank you in
2011 Oct 24
3
Creating a histogram properly
Hello all,
I'm trying to make a histogram of the data contained in my dataframe.
The summary of the data gives me exactly what I want
summary (Data)
V1 V2
first001: 3 last001: 9
first002: 3 last002: 7
first003: 2 last003: 6
(Other) :52 (Other): 27
But how do I capture the names and values in vectors so I can plot them?
2011 Aug 23
2
How can I do these simulations with R code
1) The Pareto P(alfa) distribution is defined by its density f(x|alfa) =alfa*X^(-alfa-1) over (1 to infinity). Show that it can be generated as the -1/alfa power of a uniforme variate. Plot the histogram and the density.
2) The Poisson distribution P(lambda) is connected to the exponential distribution through the Poisson process in that it can be simulated by generating exponential random
2011 Oct 16
4
Editor for RD file?
Dear all, can somebody please update me on what could be the best editor to
write and edit the RD files? I need to something with syntax highlighter,
auto-completion etc (like Notepad++ for R etc.). Currently I am using plain
Notepad however expect something which could be more professional.
Thanks for your help.
[[alternative HTML version deleted]]
2011 Aug 23
3
GLM question
Hi All,
I am trying to fit my data with glm model, my data is a matrix of size n*100. So, I have n rows and 100 columns and my vector y is of size n which contains the labels (0 or 1)
My question is:
instead of manually typing the model as
glm.fit = glm(y~ x[,1]+x[,2]+...+x[,100], family=binomial())
I have a for loop as follows that concatenates the x variables as follows:
final_str=NULL
for
2011 Sep 24
3
Supporting R/Membership
Dear R Users,
I know issues like this have come up in the past. I am wondering how
many people would be interested in an online mechanism for donating to
the R Foundation or for becoming supporting members. Right now, the
link for it is somewhat buried on the R home page, and once you get
there, the options are to mail or fax a form. IIRC, Paypal was not a
good option due to some fees, but
2011 Oct 10
5
multicore by(), like mclapply?
dear r experts---Is there a multicore equivalent of by(), just like
mclapply() is the multicore equivalent of lapply()?
if not, is there a fast way to convert a data.table into a list based
on a column that lapply and mclapply can consume?
advice appreciated...as always.
regards,
/iaw
----
Ivo Welch (ivo.welch at gmail.com)
2011 Oct 31
2
rle for non concecutive
Dear all,
I would like to task you if you know a rle version that can work also in a non consecutive way too.
B.R
Alex
[[alternative HTML version deleted]]
2011 Aug 07
1
Removing funny characters from a column of a data frame
Dear all,
The 5th column of my data frame is like this-
.$.$.$.$.$,$,$...,,,,,.,,.,,...,,,,.,,....,,,T...,,,,,,,,,,,.,,,,,....,,...,,
,..,,....,,,,,...,,,..,,......,,,,,,,....,,,.,,,,....,,...G.,,,,,,,,...,,,,,,.,,
,t.,,c,,.a.,,,.A,,,,....,,,.....,,,,..........,,,,,..,,,.,,,....,,,,,...,,,$....
.,,,,..,,,...,,,,,..,,,,,,.............$..,,,,,,...,,..,,$,...,,,,,,,....,,,,,,.
2011 Aug 05
1
If find x, then y, else do nothing
I want to write code that says "If you find an element equal to 4 in this
vector for each person in the data set tested separately, then put in 1 for
2 and 2 for 4, else leave the variable as is"
u.ppl <- (unique(init.dat1$grid))
l.ppl <- length(u.ppl)
for (i in 1:l.ppl)
{
if (grep("4",init.dat1$Slide1_RESP)) {2 == 1, 4 == 2}; else
2011 Nov 25
1
variable types - logistic regression
Hello,
Is there an example out there that shows how to treat each of the predictor
variable types when doing logistic regression in R? Something like this:
glm(y~x1+x2+x3+x4, data=mydata, family=binomial(link="logit"),
na.action=na.pass)
I'm drawing mostly from:
http://www.ats.ucla.edu/stat/r/dae/logit.htm
...but there are only two types of variable in the example given. I'm
2011 Aug 20
1
Raw epoch time from XTS
Hi,
I have a very large data set stored as an xts object.
xts is very nice about showing row labels as "human readable" dates and times.
I want the actual epoch values that are stored internally. The only way I can find to access them is one-at-a-time using the internal function: xcoredata()
Calling this in an entire column, the "R" way doesn't work. It will only
2011 Aug 23
2
dummy variables from factors
Hi,
Looking at a large data set with many factors.
I would like to expand each factor variable into multiple new variables for each level. (0,1) coding.
My first though was just to code a big nasty loop, to take each level and cbind a column onto my data set. But, that seems painful. There must be a better way.
Is there an "easy" way to do this in R?
(Note, I don't want to
2011 Mar 26
1
Effect size in multiple regression
Dear all,
is there a convenient way to determine the effect size for a regression
coefficient in a multiple regression model?
I have a model of the form lm(y ~ A*B*C*D) and would like to determine
Cohen's f2 (http://en.wikipedia.org/wiki/Effect_size) for each predictor
without having to do it manually.
Thanks,
Michael
Michael Haenlein
Associate Professor of Marketing
ESCP Europe
Paris,
2011 Nov 19
3
Data analysis: normal approximation for binomial
Dear R experts,
I am trying to analyze data from an article, the data looks like this
Patient Age Sex Aura preCSM preFreq preIntensity postFreq postIntensity
postOutcome
1 47 F A 4 6 9 2 8 SD
2 40 F A/N 5 8 9 0 0 E
3 49 M N 5 8 9 2 6 SD
4 40 F A 5 3 10 0 0 E
5 42 F N 5 4 9 0 0 E
6 35 F N 5 8 9 12 7 NR
7 38 F A 5 NA 10 2 9 SD
8 44 M A 4 4 10 0 0 E
9 47 M A 4 5 8 2 7 SD
10 53 F A 5 3 10 0 0 E
11
2011 Nov 28
2
efficient way to fill up matrix (and evaluate function)
Hi All,
I want to do something along the lines of:
for (i in 1:n){
for (j in 1:n){
A[i,j]<-myfunc(x[i], x[j])
}
}
The question is what would be the most efficient way of doing this. Would
using functions such as sapply be more efficient that using a for loop?
Note that n can be a few thousand. Thus atleast a 1000x1000 matrix.
Thanks,
Sachin
[[alternative HTML version
2011 Nov 15
3
how to indice the column in the data.frame
hi R,users
Now I read a data from a txt file
newdata<-read.table("1.txt")
in the 1.txt ,there are several column shown as below
1 3 4 5
2 3 5 6
4 5 6 7
so when I want analysis the second column
anadata<-newdata$V2
but my question I can not use some certain variable to indice the column?
e.g
cmn=2
anadata<-newdata$Vcmn
how can I finish this command ?can anyone help me ? thank
2003 Mar 07
1
Type IV sum of squares
To anyone who can help:
I am trying to do an analysis of variance with a very unbalanced design and a few empty cells. How do I get R to use type III and more importantly type IV sums of squares?
Thanks
Deven Hamilton
Department of Sociology
University of Washington