R and SPSS giving different weighted results Edited again: I think that I figured out what was happening. It appears that SPSS rounds weighted counts to the nearest whole number, and then bases any subsequent statistics off of that. My sample was large enough that this caused minor (but noticeable) differences between R (which doesn't round) and SPSS (which does). Since I was looking at percentages the discrepancy in the counts wasn't apparent. I'll leave the rest here in case this is useful to anyone else, or if someone wants to correct me.
Original Question:
My basic problem is that when using weighting in R and SPSS I get different results. The only question I've seen with regards to this is this one: Why do R and SPSS give different SEs (complex survey with weights)? While the answers there are helpful for future reference, I'm currently doing very simple analyses for which those answers wouldn't seem to apply.
I have a dataset that uses sample weights. I have been using SPSS for analysis since it is what other people on my research team are using, but I generally prefer R. I tried to use R's survey package in order to calculate some proportions (using the function svytable). Currently we've been compiling fairly basic statistics using SPSS, largely proportions. I figured that (1) since the analysis is very simple and (2) the weighting scheme is simple (it only involves a single weighting variable, no strata etc.), getting identical results should be simple. My results get close in an absolute sense (within +/- .1), although for cases with small proportions  edit: percentages (I was sloppy) the relative difference can be relatively large. I'm wondering if anyone knows why there would be differences.
The dataset is large and can't be reproduced here, however the weighting code I am using is:
In SPSS:
WEIGHT BY weightvariable.
CROSSTABS interestingstuff BY relevantvariable.

In R:
library(survey)
design<-svydesign(ids=~0,weights = weightvariable, data=mydata)
results<-svytable(~interestingstuff+relevantvariable, design)
#this is to convert from counts to percentages
results<-round(t(t(results)/colSums)*100,3)

Any help would be greatly appreciated.
 A: In answer to my own question, after some comparisons between the count output (instead of the percentage/proportion output) shows that the problem is that the SPSS default is to round weighted counts to the nearest whole number. Subsequent statistics (at least in my application) are based on these rounded numbers. R does not default to rounded counts so when calculating percentages/proportions the R results will be slightly different than the SPSS output. My understanding of the SPSS documentation is that you can choose whether or not SPSS will round or truncate, but there is no obvious way to get it to do neither (even when computing exact statistics SPSS says it will round prior to calculating the statistics, which seems slightly deceptive, but I digress). You can mimic the default SPSS behavior in R by simply doing round(output,0) where the output is the raw counts given by a function like svytable.
A: The ASIS option in SPSS CROSSTABS will calculate with the fractional weighted cell counts with no adjustments, except for exact tests. The exact tests in CROSSTABS use algorithms provided by Cytel, makers of StatXact, and these do not allow non-integer values for cell counts.
Part of the issue here is that you're making an "apples to oranges" comparison in that the WEIGHT command, despite allowing non-integer values, is a frequency weighting function, and CROSSTABS does not recognize or make specific adjustments for sampling weights. The svytable function in R is designed for sampling weights. The SPSS Complex Samples module has a CSTABULATE procedure that handles sampling weights. The CTABLES procedure does have some basic sampling weight handling in the form of "effective base weighting" (where you specify a weighting variable in the procedure, not using the WEIGHT command).
