Displaying 20 results from an estimated 553 matches for "fac".
Did you mean:
ac
2009 Nov 05
2
[LLVMdev] Strange error for libLLVMCore.a
...2.6 (buid with llvm-gcc)
Example source code:
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
I change
LLVMCreateJITCompiler(&engine, provider, &error);
to
LLVMCreateJITCompiler(&engine, provider, 3, &error);
$ llvm-gcc `llvm-config --cflags` -c fac.c
$ g++ `llvm-config --libs --cflags --ldflags core analysis
executionengine jit interpreter native backend engine` fac.o -o fac
fac.o: In function `main':
c:\Work\llvm//fac.c:20: undefined reference to `LLVMModuleCreateWithName'
c:\Work\llvm//fac.c:21: undefined reference to `LLVMInt32Ty...
2009 Aug 08
4
how to get id of other table
Hi All,
I have a doubt regarding join tables
I''m having 2 models
1)Fac
2)Cont
and both models have " has and belong to many" relationships
so there are 3 tables
1)facs
2)conts
3)conts_facs
then i''m fetching the data in controller as
@conts=Cont.find(:all])
@cfacs=Fac.all(:joins=>:conts, :select=>"facs.name")
but i dont know how to...
2005 Mar 31
1
Contingency table: logistic regression
Hi,
I am analyzing a data set with greater than 1000 independent cases
(collected in an unrestricted manner), where each case has 3 variables
associated with it: one, a factor variable with 0/1 levels (called XX),
another factor variable with 8 levels (X) and a third response variable
with two levels (Y: 0/1). I am trying to see if X1 has an effect on the
relationship between X2 and the proportion of 1-s in Y.
I have three questions:
a) I have never used glm-s fo...
2013 Jan 17
3
Colors in interaction plots
Hi,
I am trying to plot an interaction.plot with different color for each
level of a factor. It has an erratic behavior.
For example, it works for the first interaction.plot below, with the
example from the ALDA book, but not with the other plots, from the NPK
dataset:
# from http://www.ats.ucla.edu/stat/r/examples/alda/ch2.htm
tolerance <- read.csv("http://www.ats.ucla.edu/s...
2013 Dec 14
2
Change factor levels
Suppose I have a dataframe 'd' defined as
L3 <- LETTERS[1:3]
d0 <- data.frame(cbind(x = 1, y = 1:10), fac = sample(L3, 10, replace
= TRUE))
(d <- d0[d0$fac %in% c('A', 'B'),])
x y fac
2 1 2 B
3 1 3 A
4 1 4 A
5 1 5 A
6 1 6 B
8 1 8 A
Even though factor 'fac' in 'd' only has 2 levels, but it seems to bear the
birthmark of 3 levels from its parent ...
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I realised that
lm1 <- lm(vec ~ Fac)
fitted(lm1)
did what I want.
But there must be another way to do this, and it would be good to be
able to apply other functions than mean() in this way.
Cheers, Murray
--
Dr Murray J...
2009 Jun 03
1
Need help understanding output from aov and from anova
Hi all,
I noticed something strange when I ran aov and anova.
vtot=c(7.29917, 7.29917, 7.29917) #identical values
fac=as.factor(c(1,1,2)) #group 1 has first two elements, group 2 has
the 3rd element
When I run:
> anova(lm(vtot~fac))
Analysis of Variance Table
Response: vtot
Df Sum Sq Mean Sq F value Pr(>F)
fac 1 1.6818e-30 1.6818e-30 0.3333 0.6667
Residuals 1 5.0455e-30 5.0455e-...
2013 Mar 19
1
How to automate this model selection algorithm?
...ow it down: removing each interaction
term or un-interacted main effect one by one, checking the AIC, and
retaining the model that gives me the lowest AIC. I then want to repeat
the procedure on the retained model.
Here is a simple example:
set.seed(42)
library(mgcv)
N=220
fac = ceiling(runif(N)*2)
a = rnorm(N); b = rnorm(N); c = rnorm(N); d = runif(N); e = rnorm(N);
y = a^fac + b*e + d/(e+1)
m1 = gam(y~ as.factor(fac)
+ s(a)
+ s(b)
+ s(c)
+ s(d)
+ te(a,b,c)
+ te(a,d,by=as.factor(fac))
)
m2 =...
2010 Apr 21
5
Bugs? when dealing with contrasts
...9;contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Below are two cases where I don't seem to be getting contr.sum
contrasts even though they were specified. Are these bugs?
The first case is an interaction between continuous and factor variables.
The second case contrasts= was specified as an arg to lm. The second
works ok if we set the contrasts through options but not if we set it
through an lm argument.
>
> # 1. In this case I don't seem to be getting contr.sum contrasts:
>
> options(contrasts = c("c...
2006 Jan 23
1
Sample rows in data frame by subsets
Hi,
I need to resample rows in a data frame by subsets
L3 <- LETTERS[1:3]
d <- data.frame(cbind(x=1, y=1:10), fac=sample(L3, 10, repl=TRUE))
x y fac
1 1 1 A
2 1 2 A
3 1 3 A
4 1 4 A
5 1 5 C
6 1 6 C
7 1 7 B
8 1 8 A
9 1 9 C
10 1 10 A
I have seen this used to sample rows with replacement
d[sample(nrow(d), replace=T), ]
x y fac
7 1 7 B
2 1 2 A
1 1 1...
2010 Aug 25
5
lattice help required
hello,
i want to stack two lattice plots beneath each other using one x-axis and
sharing the same text-panels,
like:
#####################################################################
library(lattice)
y1 <- rnorm(100,100,10)
y2 <- rnorm(100,10,1)
facs<-expand.grid(Sites=rep(c("Site I","Site II"),25),Treatment=c("A","B"))
pl1<-dotplot(y1 ~ facs$Treatment|facs$Sites,
scales = list(x = list(rot = 90, tck=c(1,0))))
pl2<-dotplot(y2 ~ facs$Treatment|facs$Sites,
scales = list(x...
2012 Jan 02
4
Create variable with AND IF statement
Hello,
I'm using SPSS at work but really would like to switch to R. Right now I'm
trying to learn R in reproducing calculations I did with SPSS but am stuck
with something that is quite simple and comprehensible in SPSS-Syntax:
IF (variable1.fac = 0 AND variable2.num = 0) variable3=1.
IF (variable1.fac = 0 AND variable2.num >= 1) variable3=2.
IF (variable1.fac = 1 AND variable2.num = 0) variable3=3.
IF (variable1.fac = 1 AND variable2.num >= 1) variable3=4.
I want to create four different groups out of different conditions of two
va...
2012 May 29
1
GAM interactions, by example
Dear all,
I'm using the mgcv library by Simon Wood to fit gam models with interactions and I have been reading (and running) the "factor 'by' variable example" given on the gam.models help page (see below, output from the two first models b, and b1).
The example explains that both b and b1 fits are similar: "note that the preceding fit (here b) is the same as (b1)...."
I agree with the idea that it "...
2011 Jan 21
1
match function causing bad performance when using table function on factors with multibyte characters on Windows
[I originally posted this on the R-help mailing list, and it was suggested that R-devel would be a better
place to dicuss it.]
Running ?table? on a factor with levels containing non-ASCII characters
seems to result in extremely bad performance on Windows. Here?s a simple
example with benchmark results (I?ve reduced the number of replications to
make the function finish within reasonable time):
library(rbenchmark)
x.num=sample(1:2, 10^5, repla...
2006 Feb 28
2
sorting collection lists
I''m using collection.select lists and I would love to sort them by one
or two of the columns as the lists are getting long enough to make a
difference.
<%= options = [[''Select a Facility'', '''']] + @facility.collect {
|fac| [fac.name, fac.id] }
select ''placement'', ''facility_id'', options %>
how do I get this to order by facility.name ?
Craig
2010 Aug 15
0
unexpected behaviour with sparse.model.matrix
...I can't
seem to get this working through the most obvious routes such as
specifying drop.unused.levels = FALSE in the model.frame or trying to
pass all levels in xlev,which is an argument to sparse.model.matrix
(see code below).
Any help would be gratefully received.
Cheers,
Jarrod
fac<-factor(rep(1:10,10), levels=1:100)
mf<-model.frame(~fac, drop.unused.levels = TRUE)
mf2<-model.frame(~fac, drop.unused.levels = FALSE)
dim(model.matrix(~fac, mf))
dim(model.matrix(~fac, mf2))
dim(model.matrix(~fac, xlev=list(fac=1:10)))
dim(model.matrix(~fac, xlev=list(fac=1:100)))
dim(...
2002 May 13
1
GLM questions
Hi
I'm doing a glm analysis and I have two doubts (at least :)
1) When I run the function it gives a lot of warnings (see below) what
they mean ? (may be I'm ignorant about this analysis ...)
glm.poisson<-glm(log(Jkij+1)~fac.ano+fac.tri+fac.icesr+fac.mat+fac.ano:fac.icesr+fac.ano:fac.tri,family=poisson())
warnings()
40: non-integer x = 1.252763
41: non-integer x = 1.864785
42: non-integer x = 2.140066
43: non-integer x = 2.944439
44: non-integer x = 1.252763
45: non-integer x = 3.139439
46: non-integer x = 2.772589
4...
2001 Nov 22
1
fac.design
Dear all,
I am trying to find a R version of the S+ routine fac.design. In the help
of the package conf.design fac.design is listed under "see also". Any clues
as to where (which package) I can find fac.design?
thanks
Steve.
Steven Higgins
Department of Ecological Modelling
UFZ - Centre for Environmental Research Leipzig-Halle
Permoserstrasse 15
D-04...
2009 Jul 31
2
how use the subset?
hi ,everyone
I want subtract some dataset by subset.
>From the help running help(subset), ths information is "*subset(airquality,
Day == 1, select = -Temp)* "
while I running my script written as "*g1data<-subset(errdata, fac>12) *"
,it is wrong with the error information "*subset.default(newerrdata,
fac>12),can not find fac*"
and g1 in read from the file as shown below
*errdata<-scan("err.dat",what = list(mon=0,day=0,err=0,fac=0))*
While I changed to *g1data<-subset(errdata, errd...
2009 May 22
1
regrouping factor levels
Hi all,
I had some trouble in?regrouping factor levels for a variable. After some experiments, I have figured out how I can recode to modify the factor levels. I would now like some help to understand why some methods work and others don't.
Here's my code :
rm(list=ls())
###some trials in recoding factor levels
char<-letters[1:10]...