search for: item4

Displaying 19 results from an estimated 19 matches for "item4".

Did you mean: items
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==T], item4[z==T]) T...
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 different row but still mainta...
2012 Sep 03
1
R suitability for development project
...mmunicate 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 fold; 1, a numerical score for each of the Items (1-4) from highest to lowest and lowest to highest on a scale of 0-99 that is statistically accurate. For this example...
2013 Feb 26
2
Converting code to R Question
...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]]
2013 Apr 16
1
Path Diagram
...i 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"; node [fontname=&qu...
2006 Jul 19
4
Wrap a loop inside a function
...like.mat <- matrix(numeric(length(items) * length(theta)), ncol = length(theta)) for(i in 1:length(items)) like.mat[i, ] <- pcm(theta, items[[i]], score[[i]]) } # begin example theta <- c(-1,-.5,0,.5,1) items <- list(item1 = c(0,1,2), item2 = c(0,1), item3 = c(0,1,2,3,4), item4 = c(0,1)) score <- c(2,1,3,1) (foo(theta, items, score)) # R output from function foo [1] 0.8807971 0.8175745 0.7310586 0.6224593 0.5000000 However, what I am expecting from the function foo is > like.mat [,1] [,2] [,3] [,4] [,5] [1,] 0.118499655 0.1797...
2006 Jul 20
2
Timing benefits of mapply() vs. for loop was: Wrap a loop inside a function
...an the looping constructs such as for, while etc as a matter of practice. However, it seems the mapply function in this case is slower (in terms of CPU speed) than the for loop. Here is an example. # data needed for example items <- list(item1 = c(0,1,2), item2 = c(0,1), item3 = c(0,1,2,3,4), item4 = c(0,1), item5=c(0,1,2,3,4), item6=c(0,1,2,3)) score <- c(2,1,3,1,3,2) theta <- c(-1,-.5,0,.5,1) # My old function using the for loop like.mat <- function(score, items, theta){ like.mat <- matrix(numeric(length(items) * length(theta)), ncol = length(theta)) for(i in 1:leng...
2006 Feb 27
4
Getting nuts with sortables...
...t;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</li> </ul> <%= sortable_element "lista", :containment => "list", :url => { :action => "lista_action" } %> <%= sortable_element "listb", :droponempty...
2004 Jun 08
2
Recoding a multiple response question into a series of 1, 0 variables
...3) How I want the data to be be coded: I want each field to be one of the five items and I want each field to contain a 1 or 0 code--1 if they mentioned the item, 0 otherwise. Given the above data, the new fields would look as follows: Item1 Item2 Item3 Item4 Item5 Person1 0 1 0 1 0 Person2 1 0 1 1 1 Person3 0 1 1 0 0 I know how to do this using...
2012 Jul 17
2
Problem creation tensor
...matrices, every matrix on the rows has users and on columns has items, in my case films. Element of index (i, j) represent the rating expressed by user i about item j. I have a matrix for each of professions. An example of a this type of matrix is: item 1 item 2 item 3 item4 id user 1 1 ? ? 5 id user 2 ? 3 3 ? id user 3 2 ? 3 2 id user 4 ? ? ? 4 ... So user 1 don't like item 1 but he likes so much item...
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2012 May 29
1
model frame and formula mismatch with latent class analysis poLCA
...set contains binary scores of, for instance, 200 students on 100 items. These numbers could even be more in due course. The resulting dataframe on which i want to perfrom LCA looks like shown below (first five person). Each row corresponds to scores of a person on the 100 items. item1 item2 item3 item4 item5 item6 . . . . . . item97 item98 item99 item100 1 1 0 1 1 1 . . . . . . 1 0 1 1 0 0 0 0 1 1 . . . . . . 1 0...
2007 Nov 25
1
Constructin a call of function including permutation of column names - how to escape parentheses?
Dear R-users, I would like to construct a list of arguments for a function in a format function (list(item1=c("A","B"), item2=c("B","C")), item3=...): The individual vectors in the list are permutations of colnames of a dataframe. The trouble is that I am not able to handle escaping of parentheses correctly. I was trying the following: library(gregmisc)
2007 Oct 23
3
CheckListBox : delete method bug !
...0.upto(3) { |i| c.append "item#{i+1}" } end evt_listbox lb.wx_id do |event| lb.delete event.index end end helloframe.show end --------------- If I run the application, and if I select the "item2", this item is deleted as expected. But afterwards, "item4" cannot be checked. If I just remove/comment the delete method within the Wx::CheckListBox class, everything is OK and I can check/uncheck all items as expected after the deletion. I don''t know if it is a wxRuby or a wxWidgets problem, but given all issues I discovered with CheckLis...
2011 May 02
3
Help converting a data.frame to ordered factors
I have a 96x34 array of Likert scale data (96 cases, 34 items) of ordered factors (strongly disagree, disagree, neutral, agree, strongly agree) that are coded numerically (1 through 5). I cannot seem to convert this array (in any class) into ordered vectors. I have all the cases as vectors of ordered factors, but any which way I reassemble those vectors loses the ordered factors and converts
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
...and again, the estimates are off, but again very close to being correct. This is best illustrated via the examples: ### Sample data set set.seed(1234) tmp <- data.frame(item1 = sample(c(0,1), 20, replace=TRUE), item2 = sample(c(0,1), 20, replace=TRUE), item3 = sample(c(0,1), 20, replace=TRUE),item4 = sample(c(0,1), 20, replace=TRUE),item5 = sample(c(0,1), 20, replace=TRUE)) ## Use function mml2 (below) with optim with use of gradient > mml2(tmp,Q=10) $par [1] -0.2438733 0.4889333 -0.2438733 0.4889333 0.7464162 $value [1] 63.86376 $counts function gradient 45 6 $converg...
2005 Jan 31
1
naming list elements
All - Each time through a loop I create a new dataset, which I would like to append to a list object. Each item of the list should be the data matrix created in that step of the loop; I would like the NAME (or tag) of that list item to be assigned the value of a character string: I've tried something like this: running.list <- numeric(0) for(i in 1:num.files){ ..... running.list
2005 Aug 02
3
Scriptaculous: Sortable (dragdrop.js) onUpdate
...ng code, it doesn''t look like the onUpdate() event is firing. Am I doing something wrong? <ul id="testSort"> <li id="item1">item 1</li> <li id="item2">item 2</li> <li id="item3">item 3</li> <li id="item4">item 4</li> <li id="item5">item 5</li> </ul> <script type="text/javascript"> //<![CDATA[ Sortable.create( "testSort", { onUpdate : function() { alert("updating"); } } ); //]]> </script> Thanks, Ed C. ------...
2010 Feb 25
2
Restructure some data
Suppose I have a data frame like "dat" below. For some context, this is the format that represents student's taking a computer adaptive test. first.item is the first item that student was administered and then score.1 is the student's response to that item and so forth. item.pool <- paste("item", 1:10, sep = "") set.seed(54321) dat <- data.frame(id =