Displaying 20 results from an estimated 4000 matches similar to: "quick way to construct formula"
2013 May 29
3
bootstrap
Hi,
You might need to check library(boot).? I have never used that before.? So, I can't comment much.? It is better to post on R-help list.? I had seen your postings on Nabble in the past.? Unfortunately those postings were not accepted in R-help.? You have to directly post at ? r-help at r-project.org after registering at:
https://stat.ethz.ch/mailman/listinfo/r-help
?
2008 Dec 22
1
sem package fails when no of factors increase from 3 to 4
#### I checked through every 3 factor * 3 loading case.
#### While, 4 factor * 3 loading failed.
#### the data is 6 factor * 3 loading
require(sem);
cor18<-read.moments();
1
.68 1
.60 .58 1
.01 .10 .07 1
.12 .04 .06 .29 1
.06 .06 .01 .35 .24 1
.09 .13 .10 .05 .03 .07 1
.04 .08 .16 .10 .12 .06 .25 1
.06 .09 .02 .02 .09 .16 .29 .36 1
.23 .26 .19 .05 .04 .04 .08 .09 .09 1
.11 .13 .12 .03 .05 .03
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all,
I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below.
> colnames(pos1)
[1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2011 Jun 01
3
error in model specification for cfa with lavaan-package
Dear R-List,
(I am not sure whether this list is the right place for my question...)
I have a dataframe df.cfa
2011 Dec 19
2
Summing x1 to x6
Suppose I have the following:
x1<-as.vector(rnorm(10))
x2<-as.vector(rnorm(10))
x3<-as.vector(rnorm(10))
x4<-as.vector(rnorm(10))
x5<-as.vector(rnorm(10))
x6<-as.vector(rnorm(10))
x7<-as.vector(rnorm(10))
x8<-as.vector(rnorm(10))
x9<-as.vector(rnorm(10))
x10<-as.vector(rnorm(10))
I would like the mean of x1 to x6 for each vector position. I would do
something else
2013 Apr 13
1
how to add a row vector in a dataframe
Hi,
Using S=1000
and
simdata <- replicate(S, generate(3000))
#If you want both "m1" and "m0" #here the missing values are 0
res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1})
res1[,997:1000]
#????? [,1]???????? [,2]???????? [,3]???????? [,4]???????
#x1??? Numeric,3000 Numeric,3000
2008 Oct 09
2
Singular information matrix in lrm.fit
Hi R helpers,
I'm fitting large number of single factor logistic regression models
as a way to immediatly discard factor which are insignificant.
Everything works fine expect that for some factors I get error message
"Singular information matrix in lrm.fit" which breaks whole execution
loop... how to make LRM not to throw this error and simply skip
factors with singularity
2007 May 16
1
partial least regression
hello r-helpers:
there is a .txt file:
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 y1
17 5 77 18 19 24 7 24 24 72 52 100
2 6 72 18 17 15 4 12 18 35 42 97.2
17 2 58 10 5 3 4 3 3 40 28 98
17 2 69 14 13 12 4 6 6 50 37 93
2 3 75 20 38 18 6 12 18 73 67 99
14 4 59 16 18 9 4 3 15 47 40 99.95
17 4 87 18 17 12 4 15 12 69 46 100
14 3 74 15 9 12 1 15 12 44 35 98
17 6 76 15 33 21 15 9 18 46 41 100
17 5 76 17 22 18 1
2012 Aug 09
4
debug vs regular mode
Dear all,
I had a R segmentation fault, and then invoked debug mode and ran step
by step.
When I reached "terms(Y~X1*X2*...*X16)", I would then have
"segmentation" fault. However, if I just ran this under regular "R
interactive" mode, it would be fine though taking long time.
My questions are:
1. Is there a known limit of terms for a formula?
2. Why does the
2012 Aug 09
4
debug vs regular mode
Dear all,
I had a R segmentation fault, and then invoked debug mode and ran step
by step.
When I reached "terms(Y~X1*X2*...*X16)", I would then have
"segmentation" fault. However, if I just ran this under regular "R
interactive" mode, it would be fine though taking long time.
My questions are:
1. Is there a known limit of terms for a formula?
2. Why does the
2013 Apr 18
1
select and do some calculations/manipulations on certain rows based on conditions in R
Hi,
May be this helps (Assuming that there are only '0's and '1's in the dataset)
dat1<-read.table(text="
??????? ID X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15
1?? 5184??? 0??? 0??? 0??? 0??? 0?? 0?? 0??? 0??? 0??? 1???? 0????? 0????? 0????? 0????? 0????? 0
2?? 6884??? 0??? 0??? 1??? 0??? 0?? 1?? 0??? 0??? 0??? 0???? 0????? 0????? 0????? 0????? 0????? 0
3?
2018 Feb 20
5
Take the maximum of every 12 columns
Dear all,
I have monthly data in wide format, I am only providing data (at the bottom
of the email) for the first 24 columns but I have 2880 columns in total.
I would like to take max of every 12 columns. I have taken the mean of
every 12 columns with the following code:
byapply <- function(x, by, fun, ...)
{
# Create index list
if (length(by) == 1)
{
nc <- ncol(x)
2006 Nov 17
2
Data table in C
After getting one list done, I am now struggling to form a data frame in C.
I tried to do a list of lists which gives me :
$<NA>
$<NA>[[1]]
[1] "BID"
$<NA>[[2]]
[1] 0.6718
$<NA>[[3]]
[1] 3e+06
$<NA>
$<NA>[[1]]
[1] "BID"
$<NA>[[2]]
[1] 0.6717
$<NA>[[3]]
[1] 5e+06
$<NA>
$<NA>[[1]]
[1] "BID"
2011 Apr 09
2
Orthoblique rotation on eigenvectors (SAS VARCLUS)
Hi All,
I'd like to build a package for the community that replicates the output
produced by SAS "proc varclus". According to the SAS documentation, the
first few steps are:
1. Find the first two principal components.
2. Perform an orthoblique rotation (quartimax rotation) on eigenvectors.
3. Assign each variable to the rotated component with which it has the
higher
squared
2018 Feb 20
3
Take the maximum of every 12 columns
This is what I was looking for. Thank you everyone!
Sincerely,
Milu
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
2006 Mar 11
1
Non-linear Regression : Error in eval(expr, envir, enclos)
Hi..
i have an expression of the form:
model1<-nls(y~beta1*(x1+(k1*x2)+(k1*k1*x3)+(k2*x4)+(k2*k1*x5)+(k2*k2*x6)+(k3*x7)+(k3*k4*x8)+(k3*k2*x9)+(k3*k3*x10)+ (k4*x11)+(k4*k1*x12)+(k4*k2*x13)+(k4*k3*x14)+(k4*k4*x15)+(k5*x16)+(k5*k1*x17)+(k5*k2*x18)+(k5*k3*x19)+
2013 Mar 19
4
Copying rows in data frames
Hi,
I'm trying to copy the first row of one data frame to another. This is the
statement I am using :
df2[1,]<-df1[1,];
I have printed them out separately:
df1[1,] = A C D E F
But after copying:
df2[1,] = 96 29 88 122 68
Why isn't it copying? They are both data frames, and "as.character" isn't
working either.
Thanks for your input :)
[[alternative HTML version
2006 Nov 06
5
memory issues with new release (PR#9344)
Full_Name: Derek Elmerick
Version: 2.4.0
OS: Windows XP
Submission from: (NULL) (38.117.162.243)
hello -
i have some code that i run regularly using R version 2.3.x . the final step of
the code is to build a multinomial logit model. the dataset is large; however, i
have not had issues in the past. i just installed the 2.4.0 version of R and now
have memory allocation issues. to verify, i ran
2010 Jun 06
1
I need help in analyzing
I'm sory for my weak english. I need to analyze this subject :
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 y
0 0 1 0 0 1 0 0 1 0 czarne
1 1 0 0 0 0 1 0 0 0 rude
0 0 1 0 0 1 1 0 0 0 braz
0 0 1 0 1 0 1 0 0 0 blond
1 0 0 0 0 1 0 0 0 1 rude
1 1 0 0 0 0 0 0 0 1 blond
0 0 1 1 0 0 0 0 1 0 czarne
1 0 0 1 0 0 1 0 0 0 blond
0 0 1 0 0 1 1 0 0 0 blond
1 0 0 0 0 1 1 0 0 0 czarne
0 0 1 0 0 1 0 0 0 1 czarne
1 0 1 0 0 0
2012 Aug 01
2
how to subset the data frame by lines
I defined a data.frame by a two-dimensional array.
> aa = data.frame(rbind( 11:20, 1:10))
> aa
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10
1 11 12 13 14 15 16 17 18 19 20
2 1 2 3 4 5 6 7 8 9 10
Now I want to use the data in the second line of aa which from 1 to 10 to
output.But I find that when I use the aa[[1]][1:10] and it seems be mistake.
aa[[1]][1:10]
[1] 11 1 NA NA NA