search for: item1

Displaying 20 results from an estimated 62 matches for "item1".

Did you mean: items
2009 Mar 07
4
merge data frames with same column names of different lengths and missing values
...ad hoped that when I merged the dataframes, every column with the same name would be merged, with the value in a complete cell overwriting the value in an empty cell from the other data frame. I cannot seem to achieve this result, though I've tried several merge adaptations: x <- data.frame(item1=c(NA,NA,3,4,5), item2=c(1,NA,NA,4,5), id=1:5) y <- data.frame(item1=c(NA,2,NA,4,5,6), item2=c(NA,NA,3,4,5,NA), id=1:6) merge(x,y,by="id") #I lose observations here (n=1 in this example), and my items are duplicated - I do not want this result id item1.x item2.x item1.y item2.y 1 1...
2013 Mar 21
1
Error Message During ANOVA
...ych research. I don't understand the error message I am getting or how to fix it. Any suggestions will be greatly appreciated df1=read.table("fastfood.txt", header=TRUE); df1 > > c(t(as.matrix(df1))) > > r = c(t(as.matrix(df1))) # response data > > r > f=c("item1","item2", "item3") > k=3 > n=6 > tm =gl(k,1, n*k, factor(f)) > tm [1] item1 item2 item3 item1 item2 item3 item1 item2 item3 item1 item2 item3 [13] item1 item2 item3 item1 item2 item3 Levels: item1 item2 item3 > av=aov(r~tm) > > Error in model.frame.def...
2013 Mar 01
2
issue creating a subset
I'm performing item response theory with eRm packages I am excluding the persons that doesn't fit in the infit/outfit persons. for that I created a condition. then I have to create a new subset or matrix but with the condition. So: ORIGINAL matrix<-cbind(item1, item2, item3, item4) IF I PERFORM A head(matrix) item1 item2 item3 item4 3 2 3 1 3 1 2 4 THEN I CREATE THE LOGIC CONDITION z<-thing==T THEN I TRY TO CREATE THE NEW MATRIX BUT WITH THE CONDITION matrix2<-cbind(item1[z==T], item2[z==T], item3[z...
2008 Jan 10
1
data.frame manipulation: Unbinding strings in a row
Hi all, I have a data.frame I received with data that look like this (comma separated strings in last row): ID Shop Items ID1 A1 item1, item2, item3 ID2 A2 item4, item5 ID3 A1 item1, item3, item4 But I would like to unbind the strings in col(2) items so that it will look like this: ID Shop Items ID1 A1 item1 ID1 A1 item2 ID1 A1 item3 ID2 A2 item4 ID2 A2 item5 ID3 A1 item1 ID3 A1 item3 ID3 A1 item4 Meaning each item is on a dif...
2008 May 02
2
Transform values from one column into column names of new dataframe
Hi, I have a question about reformatting data. It looks like it should be simple, but I've been working at it for awhile now and it's about time I ask for help. My data look like this: ITEM VALUE STEP item1 A first item2 C first item2 D second item1 A second item3 A first item3 B second item3 A third I just want to transform it so they look like this: ITEM FIRST SECOND THIRD item1 A A NA item2 C D...
2006 Jun 10
3
RJS & nested divs
I''m a newbie and I''ve been trying to figure this out for a little while now, hopefully someone can point me in the right direction. case1 <div id="new"> </div> case2 <div id="new"><div id="item1"></div></div> <div id="new2"><div id="item1"></div></div> With RJS in case1, I can access "new" with page[''new'']. What would the RJS syntax be if I wanted to access "item1" in "new2"?...
2011 Aug 21
1
rank analysis - reinventing the wheel?
...whole at the start and keep it fixed. Anyway, is there a pacakge/function in R that does something like this so I don't have to reinvent the wheel? If not, any help on how to do this efficiently in R would be great. Here is a super simple example using 3 fractiles: independent data frame: item1 item2 item3 1 18 15 16 2 12 12 17 3 20 13 18 dependent data frame: item1 item2 item3 1 3 1 6 2 2 2 7 3 1 3 8 fractiles by row by item: (done with independent data frame, redefining fractiles each row) fractiles: 1...
2012 Sep 03
1
R suitability for development project
...so possibly finding someone proficient in R that would be interested in doing the coding. I would like to preface my inquiry that while I am not a programmer I can communicate in a dialog my objectives. An array of rank ordered data looks like this: Item-Rank First Second Third Fourth Totals Item1 6 8 0 0 14 Item2 7 5 2 0 14 Item3 1 1 11 1 14 Item4 0 0 1 13 14 Totals 14 14 14 14 The required output of R will be two fo...
2006 Aug 06
2
help with method_missing in ActiveRecord
I am serializing a data object (FooData) into an ActiveRecord column (Foo). I''d like to be able to do delegate methods to the data class if the Foo class doesn''t have that attribute. So instead of: f = Foo.new f.data.item1 I''d like to do: f = Foo.new f.item1 I was hoping that I could add a method_missing method to my Foo class and call methods in the FooData class but I''m not sure how to go about doing that. In my example below, I get Stack Level too deep errors. class Foo < ActiveRecord::Bas...
2013 Feb 26
2
Converting code to R Question
...e final variable. I have to do this for five scales with each scale having 6 items half of which may have the 1 response pattern and half the 2 pattern. Any suggestions on how best to tackle this in R would be helpful. Craig ********** Old SPSS code sample ********** Compute Variable = 0. IF (item1 = 1) Variable = Variable +1 . IF (item2= 2) Variable = Variable +1 . IF (item3 = 1) Variable = Variable +1. IF (item4 = 2) Variable = Variable +1. EXECUTE . [[alternative HTML version deleted]]
2006 Oct 02
1
multilevel factor model in lmer
...del such as a two-parameter item response model. The one parameter model is straightforward. A two-factor model requires a set of factor loadings multiplying a single random effect. For example, a logit model for the ith subject responding correctly to the jth item (j=1,..,J) is logit[p(ij)] = a1*item1(i) + ... + aJ * itemJ(i) + lambda1*item1(i)*u(i) + ... + lambdaJ*itemJ(i)*u(i) where the lambdas are factor loadings, with lambda1 fixed to 1.0 and item1-itemJ are dummy variables for the items. Thanks, Dan =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Daniel A. Powers, Ph.D. Department of So...
2013 Apr 16
1
Path Diagram
Hi All, Apologies if this has been answered somewhere else, but I have been searching for an answer all day and not been able to find one. I am trying to plot a path diagram for a CFA I have run, I have installed Rgraphviz and run the following: pathDiagram(cfa, min.rank='item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12', max.rank='SMP, AAAS', file='documents') I get the following message and output: Running dot -Tpdf -o documents.pdf documents.dot digraph "cfa" { rankdir=LR; size="8,8";...
2005 Dec 19
2
Difficulty using correct moldel for the data in DB
...(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) , `cat_id` INTEGER(11), `rank` INTEGER , PRIMARY KEY(`id`) ); CREATE TABLE `cats` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255), PRIMARY KEY(`id`) ); CREATE TABLE `fusions` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `item1_id` INTEGER(11), `item2_id` INTEGER(11) , `product_id` INTEGER(11), PRIMARY KEY(`id`) ); Now... Creating one-to-many relationship for item/category is cake. How do I set up my model for item and fusion so I can have something like below in my view? <% for fusion in @item.fusions %> <...
2006 Sep 28
3
ruby alternative to php's implode and expload functions
is there a method similar to php''s expload function in ruby. i have a database field that contains an array of items, when i output this field i notice the items are seperated by ''-'' e.g item1-item2-item3. how would i go about putting them back into an array in ruby. for example in PHP i would just do this: $field; // = item1-item2-item3 $field_as_array = explode(''-'',$field); -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~...
2005 Dec 14
1
Glitch when creating online help
...list="f") This creates the package skeleton, with a template f.Rd provided. Edit f.Rd to contain ================ \name{f} \alias{f} \title{ ~~function to do ... ~~ } \description{ ~~ A concise (1-5 lines) description of what the function does. ~~ } \usage{f(x)} \arguments{ \item{item1}{ This is item 1. } \item{itemlist}{ Here is a list. \describe{ \item{subitem1}{Item 1 of the list.} \item{subitem2}{Item 2 of the list.} } } \item{item3}{ This is the item after the list. } } ================ Then at the command prompt: R CMD INSTALL --build...
2012 Mar 18
2
word frequency count
Hi: I have a dataframe containing comma seperated group of words such as milk,bread bread,butter beer,diaper beer,diaper milk,bread beer,diaper I want to output the frequency of occurrence of comma separated words for each row and collapse duplicate rows, to make the output as shown in the following dataframe: milk,bread 2 bread,butter 1 beer,diaper 3 milk,bread 2 Thanks for help! deb
2009 Jun 16
0
Help implementing a simple Python port
...na(pred.out)) # calculated the weighted slope one estimate pred.out[a]=sapply(a, function(i) { sum(unlist(lapply(b,function (j) { sum((d[j]+diffs[j,i])*freqs[j,i])/rowSums(freqs)[i] }))) }) names(pred.out)=colnames(tr.set) return(pred.out) } # end function # test 1, using example from [1] john=c(item1=5, item2=3, item3=2) mark=c(item1=3, item2=4, item3=NA) tr.set1=rbind(john,mark) lucy1=c(item1=NA, item2=2, item3=5) pred(tr.set1,lucy1) ## item1=4.33 --> correct # test 2, using example from [2] alice=c(squid=1.0, octopus=0.2, cuttlefish=0.5, nautilus=NA) bob=c(squid=1.0, octopus=0.5, cuttl...
2009 Oct 24
6
Working with ListCtrl and ListItem
Hi List, I''m trying to get my ListCtrl to work. Currently I''ve managed to fill my ListCtrl with items, but I think it''s not the most beautiful way: class MyList < Wx::ListCtrl def initialize(parent, *args) super(parent, :style => Wx::LC_REPORT|LC_HRULES ) create_layout fill_list end def create_layout self.insert_column(0, "Name")
2006 Feb 27
4
Getting nuts with sortables...
Folks, It has been a whole day spent on this but I still can''t get my mind around the most probably very stupid/basic mistake here... First, the code I use: <h3>List A</h3> <ul id="lista" > <li id="item1"> Item 1</li> <li id="item2"> Item 2</li> <li id="item3"> Item 3</li> </ul> <h3>List B</h3> <ul id="listb"> <li id="item4"> Item 4</li> <li id="item5"> Item 5&l...
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but